June 2019
Beginner to intermediate
770 pages
19h 24m
English
SQL tables don't require a primary key. However, it's a rather poor design that omits primary keys for the rows of a given table. As we noted in Chapter 11, Storing and Retrieving Objects via Shelve, there might be an attribute (or a combination of attributes) that makes a proper primary key. It's also entirely possible that no attribute is suitable as a primary key and we must define surrogate keys.
The previous examples use surrogate keys created by SQLite. This is perhaps the simplest kind of design because it imposes the fewest constraints on the data. If we don't generate surrogate keys, then a primary key value cannot be updated; this becomes a rule that the application programming must enforce. ...
Read now
Unlock full access