| | 371 | '''Note on primary key choice:''' because R2 has two candidate keys, either could be promoted to primary key. We chose {user_id} because it is a small immutable surrogate integer that keeps foreign keys in Reservations compact and stable if an email address ever changes. However, '''{email} is an equally valid primary key choice''' from a normalization standpoint: it is non-null, unique, and determines every other attribute of R2 (email -> user_id -> first_name, last_name, password, user_type_id). Either choice preserves BCNF. The alternative key (email) remains enforced in the DDL by a UNIQUE constraint regardless of which candidate is promoted to primary key. |