Auto-Generated Keys
One of the popular ways to design tables these days is to use sequence numbers as primary key values. Some databases let you define a column as being a sequenced value. Others include special sequencer objects. Even if the database doesn't support sequences, you can still create your own sequence table to generate the key value.
The advantage of the sequence numbers is that you don't have to worry about coming up with a unique set of keys. You can't rely on people having unique first, middle, and last names, so you must come up with an additional key to distinguish people. With a sequence number, however, you have a single key column.
Note
You can only use auto-generated keys when you have a single-column key. That is, if ...
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