How to Delete

The delete SQL statement allows us to remove existing records from a table. We need to specify what are the records to delete by using a where clause. Caution, if you omit the where clause, all the records in the table will be deleted!

-- John Smith is fired
delete from employee where last_name = 'Smith' and first_name = 'John';

-- We can delete several rows, in this case a range of emp_id
delete from employee where emp_id > 9990 and emp_id < 9999;

IN THIS PAGE