

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: CRUD
incomplete
2: Insert Statement
incomplete
3: Auto Increment
incomplete
4: Manual Entry
incomplete
5: Count
incomplete
6: WHERE Clause
incomplete
7: Finding NULL Values
incomplete
8: DELETE
incomplete
9: Danger of Deleting Data
incomplete
10: Update Query in SQL
incomplete
11: Object-Relational Mapping (ORMs)
incomplete
12: Query Practice – User Count
incomplete
13: Query Practice – Country Codes
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
When a user deletes their account on Twitter, or deletes a comment on a YouTube video, that data needs to be removed from its respective database.
A DELETE statement removes all records from a table that match the WHERE clause. As an example:
DELETE FROM employees
WHERE id = 251;
This DELETE statement removes all records from the employees table that have an id of 251!
Samantha, one of our CashPal users, has opted to delete her account and stop using our app... which makes us sad. Anyways, we need to remove her record from the database!
Delete Samantha's record from the user table.
users Table| ID | NAME | AGE | country_code | USERNAME | PASSWORD | is_admin |
|---|---|---|---|---|---|---|
| 1 | David | 34 | US | DavidDev | insertPractice | 0 |
| 2 | Samantha | 29 | BR | Sammy93 | addingRecords! | 0 |
| 3 | John | 39 | CA | Jjdev21 | welovebootdev | 0 |
| 4 | Ram | 42 | IN | Ram11c | thisSQLcourserocks | 0 |
| 5 | Hunter | 30 | US | Hdev92 | backendDev | 0 |
| 6 | Allan | 27 | US | Alires | iLoveB00tdev | 1 |
| 7 | Lance | 20 | US | LanChr | b00tdevisbest | 0 |
| 8 | Tiffany | 28 | US | Tifferoon | autoincrement | 1 |
| 9 | Lane | 27 | US | wagslane | update_me | 0 |