Data Manipulation Language

DML(Data Manipulation Language) is used to add, manipulate and delete the data inside the table. Lets discuss few DML statements.

INSERT statement

INSERT statement is used to insert new record or row values inside a table.

INSERT INTO table_name
VALUES (value1, value2, value3,...);

In the above query, you have to specifies values for all the columns in a row. If you want to insert values to specific column then use the sql having following syntax:

INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...);

In above form, each column will have its corresponding values.

UPDATE statement

UPDATE statements are used to update existing records or rows in a table.

Note : Always use WHERE clause while updating a table else all the columns in each row in a table will get updated.

UPDATE table_name
SET column1 = value1, column2 = value2,... WHERE column = value;

DELETE statement

DELETE statement is used to delete one or more records (rows) from a table.

DELETE FROM table_name WHERE column = value;

To delete all the data from the table, remove the where clause.

DELETE FROM table_name;
<< Data Query Language Constraints >>