Essential Question: How can I delete records?
Mastery Objectives:
SWBAT delete records from a SQL database.
Directions: To delete records from a SQL database, you need to write the command:
DELETE FROM table_name WHERE condition;
If you don't give a WHERE condition, ALL the records in the table will be deleted.
Your instructions for this assignment are different than before, Open a google doc and write 6 commands that delete a record from the database. Use the command SELECT * from Customers; to display all the records from the database. We don't want to really delete the records from the table, otherwise we won't be able to practice with this database. Type the commands in a google doc. Use the WHERE command to specify certain records. Don't forget to put strings in quotes ''. For example:
DELETE FROM Customers WHERE Country = 'USA';
DELETE FROM Customers WHERE ContactName = 'Christina Berglund';
DELETE FROM Customers WHERE ContactName = 'Hanna Moos';
DELETE FROM Customers WHERE Address = 'Cerrito 333';
DELETE FROM Customers WHERE CustomerID = 92;
DELETE FROM Customers WHERE CustomerName = 'Godos Cocina Típica';
Write 3 more commands on your own.