Structured Query Language
Delete Queries

Whenever you delete information from a table, you want to take care not to delete any data that you still need. DELETE queries in SQL are relatively straightforward to write and can be easier to read than the information contained in a QBE window.

If you wanted to delete the record for the Acacia seeds, you would write,

DELETE FROM tblseeds WHERE name = "Acacia";

Often we want to remove data in a more complex manner. The following query removes all records with a seed name starting with the letter A.

DELETE FROM tblseeds WHERE name like 'A%';

Write SQL DELETE queries to do the following,

  1. Remove all seeds beginning with the letter H.
  2. Remove all seeds costing over £20.
  3. Remove all seeds planted in open ground in March.
  4. Remove all of the data from the table.

Now that you have emptied the table, re-import the data to continue the SQL fun.