Delete
September 13, 1998
Finally, SQL provides the DELETE operator
for deleting rows from a table. The DELETE operator follows
the syntax of:
DELETE FROM table_name
WHERE where_clause;
For example, to delete Lim Li Chuen from the
EMPLOYEES
table, you would use:
DELETE FROM EMPLOYEES
WHERE EMP_NAME = 'Lim Li Chuen';
Note that multiple rows may be deleted
if they match the where clause. Note also that you can easily
delete all rows in a table by not specifying a
WHERE clause such
as:
DELETE FROM EMPLOYEES
Obviously you should be quite careful
with DELETE!
Modifying Data
Introduction to Databases for the Web | Table of Contents
Introduction to Databases for the Web | Additional Resources
|