Professional Documents
Culture Documents
Insert:: DML Statements
Insert:: DML Statements
A Data manipulation language is basically used for insert, get, update and
delete the data from database.
It is family of computer language that include commands permitting user to
manipulate the data in a database.
DML is mostly used in SQL database. It’s provide some manipulation
command like SELECT, INSERT, UPDATE and DELETE etc.
1. INSERT:
INSERT command is used for add one or more records in database table.
Generally, this command is use when some record we want to store in table
as a rows. It’s syntax is:
INSERT INTO {table name} (‘{column name}’) values (‘{column data}’);
Department:
Subject:
Class:
Student:
Question:
Answer
2. SELECT
This command is used for retrieve rows from table in database. This
command mostly use developer fetch data from table for user
interaction.
Syntax: SELECT {column names} from {table name} where {condition}
Ex. SELECT * FROM `department` WHERE department_id='1';
Ex. We can fetch data from multiple table using JOIN command
3. UPDATE
UPDATE command is used for modify the record in database table. And it’s
syntax is:
UPDATE {table name} SET {column name=value} where {condition}
Ex. If we want to change the password of `111` user_id `student` then we use
below command:
Output:
4. DELETE
DELETE command is used for delete or erase record data into database table.
It’s syntax is:
DELETE FROM {table name} where {condition};
Ex. DELETE FROM `department` WHERE department_id='3'