3 ms·
In one sense, the unique integer is often not real data. It’s synthetic and has no meaning outside the application. I find it easier to understand when I thin
by projektfu 5y ago
In one sense, the unique integer is often not real data. It’s synthetic and has no meaning outside the application.
I find it easier to understand when I think that Codd and other database pioneers were looking at creating universal databases, not the application-specific ones we tend to use.
Furthermore, the use of auto numbering tends to make the queries easier to write but the tables less meaningful. For example, INVOICE might have a sequential invoice id that is real information, as well as a reference to customer, billing address, shipping address, etc. INVOICE_ITEM will have a foreign key to an invoice, unique number, position, stock item id (second foreign key), description, etc. PACKING_LIST might have a foreign key to INVOICE_ITEM. In my opinion, I prefer to see INVOICE_ID as part of the primary key of INVOICE_ITEM. I like being able to see the relationship in foreign keys and things like that.
These things can be a heated topic and other designers probably think I also like to murder kittens. But the data layout is, I think, what Codd was going for.