10.1. Repeated Groups
SQL does not require that a table have unique constraints, a primary key, or anything else that would ensure data integrity. In short, you can use a table pretty much like a file if you wish. Is this a bad thing?
Well, mostly yes and a little no. You should never have such a beast in your final schema, but one common programming trick is to use a table without any constraints as a staging area. You load data from an external source into one of these pseudo-tables, scrub it, and pass it along to a real table in the actual schema. The trouble is that a lot of the time, the pseudo-table is denormalized as well as full of bad data. You can do some normalization from the staging table into another set of scrubbing tables, but ...
Get Joe Celko's Thinking in Sets: Auxiliary, Temporal, and Virtual Tables in SQL now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.