Primary Keys
Every value in a database must be accessible. As values are stored at row–column intersections in tables, it’s clear that a value’s location refers to a specific table, column, and row. You can identify a table or column by its unique name. Rows are unnamed, however, and require a different identification mechanism called a primary key. A primary key is:
Required. Every table has exactly one primary key. Remember that the relational model views a table as an unordered set of rows. Because there’s no concept of a “next” or “previous” row, you can’t identify rows by position; without a primary key, some data would be inaccessible.
Unique. Because a primary key identifies a single row in a table, no two rows in a table can have the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access