5 questions to test your understanding
A developer deletes a row from the Customers table for a customer who has 5 active orders in the Orders table. The Orders.customer_id column is a foreign key referencing Customers.id, with no cascade behavior configured. What happens?
A developer proposes using users' email addresses as the primary key in the Users table since emails are unique per user. What is the primary risk of this design?
A primary key should typically consist of a single column.
A foreign key column in one table should have the same name as the primary key column it references in another table.
Why is enforcing referential integrity through database constraints preferable to relying on application code to check validity?