The model underneath.
WHAT A RELATIONAL DATABASE STORES
Data in tables, as rows and columns.
WHAT A TABLE REPRESENTS
One kind of thing.
WHAT A ROW IS
One instance of that thing.
WHAT A COLUMN IS
One attribute, with a defined type.
WHAT A PRIMARY KEY IS
A column, or set of columns, uniquely identifying each row.
WHY EVERY TABLE NEEDS ONE
Without it, rows cannot be reliably referenced or updated individually.
WHAT A FOREIGN KEY IS
A column referencing another table's key.
WHAT IT ENFORCES
That the referenced row exists.
WHY THAT MATTERS
It prevents orphaned data, which application code routinely fails to prevent.
WHAT RELATIONSHIPS EXIST
One to one One to many Many to many
WHAT MANY TO MANY REQUIRES
A joining table holding pairs of keys.
WHAT A SCHEMA IS
The structure: tables, columns, types, keys and constraints.
WHAT A CONSTRAINT DOES
Prevents invalid data being stored at all.
WHY CONSTRAINTS BELONG IN THE DATABASE
Applications change, several may write, and the database is the last line.
WHAT TO NEVER RELY ON ALONE
Application validation.
WHY
A script, an import or a second application bypasses it entirely.