Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Design and Development

Similar presentations


Presentation on theme: "Database Design and Development"— Presentation transcript:

1 Database Design and Development
SQL – DELETE & UPDATE

2 Learning Intention I will learn how to use SQL to DELETE data from a table and UPDATE data in a table.

3 DELETE(ing) with SQL Use a DELETE statement to remove records from a database table. The statement is followed by the name of the table and a WHERE clause which states what criteria must be met. DELETE FROM tableName WHERE criteria to be met;

4 DELETE(ing) with SQL e.g. DELETE FROM Hotel
WHERE HotelName = "The Cheapo“; e.g. To remove all 1 and 2 star hotels with no swimming pool: DELETE FROM Hotel WHERE starRating <= 2 AND swimmingPool = No;

5 UPDATE(ing) with SQL The UPDATE statement is used to alter records in a table. The statement is followed by the name of the table, a SET clause and a WHERE clause which states what criteria must be met. UPDATE tableName SET fieldName to updated value WHERE criteria to be met;

6 UPDATE(ing) with SQL e.g. The Millenium hotel in Glasgow has been upgraded from a 4 star to a 5 star hotel. UPDATE Hotel SET starRating = 5 WHERE hotelName = "Millenium";

7 Pupil Task Complete the following: SQL Booklet Tasks 7, 8 and Extension Task 2

8 Success Criteria I can create SQL DELETE statements to remove data from a table and SQL UPDATE statements to modify data in a table.


Download ppt "Database Design and Development"

Similar presentations


Ads by Google