required-memory) Some values in the table will be NULL, meaning that the attribute does not make sense for the specific product. Problem: too many NULLs
37 Translating Subclass Entities: The Rules Three approaches: 1. Object-oriented : each entity belongs to exactly one class; create a relation for each possible subtree including the root , with all its attributes. 2. E/R style : create one relation for each subclass, with only the key attribute(s) and attributes attached to that entity set. 3. Use nulls : create one relation; entities have null in attributes that don't belong to them.
38 Example Beers Ales isa name manf color
39 Object-Oriented name manf Bud Anheuser-Busch Beers name manf color Summerbrew Pete's dark Ales Beers Ales isa name manf color
40 E/R Style name manf Bud Anheuser-Busch Summerbrew Pete's Beers name color Summerbrew dark Ales Beers Ales isa name manf color
41 Using Nulls name manf color Bud Anheuser-Busch NULL Summerbrew Pete's dark Beers Beers Ales isa name manf color
42 Comparisons • O-O approach good for queries like "find the color of ales made by Pete's." – Just look in Ales relation. • E/R approach good for queries like "find all beers (including ales) made by Pete's." – Just look in Beers relation. • Using nulls might waste space if there are lots of attributes that are usually null.