Structured Query Language
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,
- Remove all seeds beginning with the letter H.
- Remove all seeds costing over £20.
- Remove all seeds planted in open ground in March.
- Remove all of the data from the table.
Now that you have emptied the table, re-import the data to continue the SQL fun.