On Fri, 2007-11-30 at 16:06 +0000, Gregory Stark wrote: > "Lincoln Yeoh" <lyeoh@xxxxxxxxxxxxx> writes: > > > The correct way to store types and subtypes in the database is to store them > > in the columns. In other words, choose attribute VALUES from a TYPE SYSTEM. > > Nothing else in the relational model needs to be changed. Something like > > this, in hypothetical SQL-like language: > > That's what we call "denormalized" data in the database world. This is why > there's such a big impedance mismatch between procedural languages and > relational databases. > CJ Date believes that normalized relations can indeed contain complex types such as images or other relations. The argument is that atomicity has no absolute meaning, but only has meaning in the context of what you're trying to do with it in the database. A string can obviously be decomposed into its parts, as can a timestamp, etc., so those aren't exactly atomic, either. [1] The impedance mismatch has more to do with the fact that the meaning of an application's internal data structures changes frequently (through revisions of the code), while data in a database needs to be consistent across long periods of time. So, a well-designed database will hold facts that have meaning in the real world and from which inferences can be made. Mapping application data structures (which contain context- sensitive information and implementation artifacts) to real-world facts is the impedance mismatch. Regards, Jeff Davis [1] Paraphrased from "Database in Depth", C.J. Date, pp 29-32 ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your message can get through to the mailing list cleanly