April 2026
Beginner
493 pages
23h 2m
English
Determining PKs is a critical decision in database design, as they must uniquely identify an entity, such as an employee, a purchase, or a product. There are multiple methods to ensure PK uniqueness, which we’ll cover in the following sections.
You can use external values as PKs. These include Social Security numbers, email addresses, serial numbers, etc.
This method comes with the benefits of being already unique and human-readable most of the time. However, the risk lies in the fact that external values can change. Once a user changes their email address, you can’t identify them uniquely anymore.
Another risk is security. If you store a sensitive value like a Social Security number ...
Read now
Unlock full access