required memory Some values in the table will be NULL meaning that the

Required memory some values in the table will be null

This preview shows page 36 - 46 out of 46 pages.

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
Image of page 36
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.
Image of page 37
38 Example Beers Ales isa name manf color
Image of page 38
39 Object-Oriented name manf Bud Anheuser-Busch Beers name manf color Summerbrew Pete's dark Ales Beers Ales isa name manf color
Image of page 39
40 E/R Style name manf Bud Anheuser-Busch Summerbrew Pete's Beers name color Summerbrew dark Ales Beers Ales isa name manf color
Image of page 40
41 Using Nulls name manf color Bud Anheuser-Busch NULL Summerbrew Pete's dark Beers Beers Ales isa name manf color
Image of page 41
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.
Image of page 42