Constraints & Keys
Constraints are rules attached to a column that the database enforces automatically, rejecting any change that would break them. They're what keeps bad data from ever making it into your tables in the first place.
NOT NULL and UNIQUE
NOT NULL requires a value in that column for every row. UNIQUE requires every value in that column to be different from every other:
Try changing the inserted row to reuse the same email in a second INSERT — the database will reject it rather than silently allowing a duplicate.
CHECK
CHECK enforces a condition on every row, beyond just "has a value" or "is unique" — for example, that a salary can never be negative:
FOREIGN KEY
A FOREIGN KEY links a column in one table to a column in another, and (when enforced) stops you from referencing a row that doesn't exist — this is how the database itself guarantees that every employee's department is a real department: