Data Manipulation Language
- DML commands are used to modify the database. It is responsible for all form of CHANGES in the database.
- The command of DML is not auto-committed that means it can't permanently save all the changes in the database. They can be rollback.
Here are some commands that come under DML
- INSERT
- UPDATE
- DELETE
Data Manipulation Language - INSERT
INSERT:
The INSERT statement is a SQL query. It is used to insert data into the row of a table.
Syntax:
INSERT INTO TABLE_NAME (col1, col2, col3,.... col N)
VALUES (value1, value2, value3, .... valueN);
OR
INSERT INTO TABLE_NAME VALUES (value1, value2, value3, .... valueN);
Example:
INSERT INTO XYZ (Author, Subject) VALUES ("hit", "DB");
Data Manipulation Language - UPDATE
Update: This command is used to update or modify the value of a column in the table.
Syntax:
UPDATE table_name SET [column_name1= value1,...column_n
ameN = valueN] [WHERE CONDITION]
Example:
UPDATE students
SET User_Name = 'Hit'
WHERE Student_Id = '3'
Comments
Post a Comment