Professional Documents
Culture Documents
LAB#4
LAB#4
LAB#4
Title:
Implementation of DML commands of SQL with suitable examples
Insert table
Update table
Delete Table
The SQL INSERT INTO Statement is used to add new rows of data
to a table in the database.These are two type of INSERT INTO
queries which are as
Syntax#1:
INSERT INTO TABLE_NAME (column1, column2, column3...column N)
VALUES (value1, value2, value3...value N);
Example:
Syntax # 2:
INSERT INTO TABLE_NAME VALUES (value1,value2,value3,...valueN);
Example:
2.SQL SELECT Statement:
4.UPDATE-SET-WHERE:
The SQL UPDATE Query is used to modify the existing records in a table.
You can use the WHERE clause with the UPDATE query to update the
selected rows, otherwise all the rows would be affected.
Syntax:
UPDATE table_name
SET column1 = value1, column2 = value2...., columnN = valueN
WHERE [condition];
Example:
SQL> UPDATE CUSTOMERS
SET ADDRESS = 'Pune'
WHERE ID = 6;
OR
5.DELETE-FROM: This is used to delete all the records of a table.
************************************