SQL DML Commands - Data Manipulation Language
TUTORIAL IN HINDI:
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.
INSERT – Insert data into a database table.
SYNTAX:
INSERT INTO TABLE_NAME (Col1, Col2, .... ColN) VALUES (value1, value2, ....valueN);
OR
INSERT INTO TABLE_NAME VALUES (value1, value2, .... valueN);
EXAMPLE:
INSERT INTO STUDENT(ID, NAME) VALUES (105, "Virat");
--------------------------------------------------------------------------------------------
UPDATE – This SQL DML command will update existing records within a table.
SYNTAX:
UPDATE Table_Name SET [Column_Name1= value1,...Column_NameN = valueN] [WHERE CONDITION]
EXAMPLE:
UPDATE STUDENT SET Sudent_Name = 'Dhoni'
WHERE Student_Id = '105';
---------------------------------------------------------------------------------------------------
DELETE – It is used to remove one or more row from a table.
DELETE FROM Table_Name [WHERE Condition];
DELETE FROM STUDENT
WHERE STudent_Name="Dhoni";
----------------------------------------------------------------------------------------------------
0 Comments