April 2026
Intermediate
1009 pages
34h 15m
English
Data—and databases—can also be quickly deleted. For example, Tobias might not be happy with (or be ashamed of) his nickname (or one of his entries) in the database and wants to delete the entry. This can be done with DELETE FROM <table name>. If you only issue this command, you delete all data. It is therefore important that you use a WHERE clause here to restrict the result set to be deleted:
DELETE FROM entry WHERE name = 'Tobi' SELECT * FROM entry
|
id |
name |
|
date |
entry |
|---|---|---|---|---|
|
1 |
Christian |
christian@xy.zzz |
2025-01-01 |
A warm welcome! The guestbook is open. |
|
3 |
Christian |
christian@xy.zzz |
2025-01-03 |
There is some truth in that. |
Table 17.13 Result of the "SELECT" Query (after the "DELETE") ...
Read now
Unlock full access