Deleting Data

THE DELETE STATEMENT

•    SQL provides for the removal of rows from database tables by use of the
DELETE statement.
•    You can delete all the rows in a table by using an unqualified DELETE statement, or you can restrict the deletion to only selected rows by adding a WHERE clause.

 

               DELETE FROM table_name WHERE condition;

 

EXAMPLE:

               DELETE FROM CUSTOMER

                    WHERE FirstName = 'David' AND LastName = 'Taylor';

 

THE DELETE STATEMENT

•    The WHERE clause specifies which record(s) should be deleted. If you omit the WHERE clause, all records in the table will be deleted.

Lesson Navigation
Previous: Updating Data