Lab 06 - SQL (DML)-01
Lab 06 - SQL (DML)-01
• Some examples:
– INSERT - insert data into a table.
– SELECT - retrieve data from the database.
– UPDATE - updates existing data within a table.
– DELETE - deletes all records from a table, the
space for the records remain.
Insert into
• The SQL INSERT INTO Statement is used to
add new rows of data to a table in the
database.
• There are two basic syntaxes of INSERT INTO
statement as follows:
– INSERT INTO TABLE_NAME (column1, column2,
column3,...columnN)] VALUES (value1, value2,
value3,...valueN);
• AND | OR clause
– YOU CAN JOIN SEVERAL CONDITIONS USING
(AND, OR)
Where clause:
• WHERE salary>1300
• WHERE name=’Ahmad’;
• WHERE city IN (‘Jenin’, ‘Ram Allah’);
• WHERE salary BETWEEN 1500 and 3000;
• WHERE OrderDate BETWEEN #07/04/1996# AND
#07/09/1996#;
• WHERE salary NOT BETWEEN 1500 and 3000;
LIKE clause