Beyond writing queries: how a well-designed database actually protects the data inside it. Normalisation, the ACID guarantees behind every transaction, and referential integrity, all demonstrated with a real SQLite engine running the exact rules a database enforces, not just described.
Loading the SQLite engine for the live demonstrations below...
One messy table, genuinely decomposed step by step. Watch each functional dependency get identified and split out, and watch the final check that proves nothing was lost along the way.
A bank transfer between two real accounts, in a real SQLite database. Try a transfer that would overdraw the sender, and watch what genuinely happens, not what's supposed to happen.
Deleting a customer who still has orders. Three real, genuinely different behaviours, each enforced by the database engine depending on how the foreign key was defined, not by convention or guesswork.
A different scenario: renaming an author's code. ON UPDATE CASCADE propagates a primary key change to every book that references it, automatically and correctly, not just ON DELETE.
Not every useful search field is a primary key.
| StudentID (Primary Key) | Surname (Secondary Key) | Name |
|---|---|---|
| S1001 | Reyes | Maya Reyes |
| S1002 | Finch | Oliver Finch |
| S1003 | Reyes | Diego Reyes |
Where does the actual query execute?