Data Manipulation Language manipulates/make changes in data present in a table.
It only affects data/records of table, not on the schema/structure of table.
INSERT, UPDATE, DELETE are the commands of DML.
INSERT: Stores data in a table or creates new records by inserting values.
UPDATE: It modifies the record in a table.
DELETE: Deletes on or more records from table.
- INSERT INTO table_name VALUES ( value1,value2,….);
- INSERT INTO table_name (column 1,column 2, column 3) VALUES (value1, value2,value3);
- INSERT INTO
- INSERT INTO
STUDENT (classyear, student_name,student_dept,student_id)
Here, user can change the sequence of columns while inserting values in table. We can increase or decrease number of columns.
Here, Single row is deleted as per where condition.
Multiple rows deleted, as three rows were present with the same name ARYA. Here, where condition decides how many records to delete.
In the above query, where condition is not specified so, all records are deleted from STUDENT table. If user want to delete single or multiple records then where condition is required. Delete query without where condition deletes all records from table.
set column_name = value
By using UPDATE command, user can update single value or multiple values in the table.
To change single value/to change specific value, ‘Where’ condition is required.
UPDATE without where condition changes complete column values in the table.