SQL Reference

Chapter 2 | Supported standards 17
DELETE statement
Use the DELETE statement to delete records from a database table. The format of the DELETE
statement is:
DELETE FROM table_name [ WHERE { conditions } ]
Note The WHERE clause determines which records are to be deleted. If you don’t include the
WHERE keyword, all records in the table are deleted (but the table is left intact).
Example
Delete a record from emp table.
DELETE FROM emp WHERE emp_id = 'E10001'
Each DELETE statement removes every record that meets the conditions in the WHERE clause.
In this case, every record having the employee ID E10001 is deleted. Because employee IDs
are unique in the Employee table, only one record is deleted.
INSERT statement
Use the INSERT statement to create records in a database table. You can specify either:
1 A list of values to be inserted as a new record
1 A SELECT statement that copies data from another table to be inserted as a set of new records
The format of the INSER
T statement is:
INSERT INTO table_name [(column_name, ...)] VALUES (expr, ...)
column_name is an optional list of column names that provides the name and order of the
columns whose values are specified in the VALUES clause. If you omit column_name, the value
expressions (expr) must provide values for all columns defined in the table and must be in the
same order that the columns are defined for the table. column_name may also specify a field
repetition, for example lastDates[4].
expr is the list
of expressions giving the values for the columns of the new record. Usually the
expressions are constant values for the columns (but they can also be a subquery). You must
enclose character string values in pairs of single quotation marks ('). To include a single quotation
mark in a character string value enclosed by single quotation marks, use two single quotation
marks together (for example, 'Don''t').
Subqueries must be enclosed in parentheses.
File type Description
'GIFf' Graphics Interchange Format
'JPEG' Photographic images
'TIFF' Raster file format for digital images
'PDF ' Portable Document Format
'PNGf' Bitmap image format