1 / 10

better explanation of the 4 methods of converting inheritance to relations

better explanation of the 4 methods of converting inheritance to relations. Start with. Convert each specialization with one superclass C, and m subclasses {S1, S2, …., Sm } where the attributes of C are {k, a1, … an} and k is the (primary) key,.

lacy
Télécharger la présentation

better explanation of the 4 methods of converting inheritance to relations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. better explanation of the 4 methods of converting inheritance to relations

  2. Start with Convert each specialization with • one superclass C, and • m subclasses {S1, S2, …., Sm} where the attributes of C are {k, a1, … an} and k is the (primary) key,

  3. 8A: Multiple relations-Superclass and subclasses • Create a relation L for C • with attributes Attrs(L) = {k, a1, … an} and • Primary Key (L) = k. • Create a relation Li for each subclass Si, 1 < i < m, • with the attributes Attrs(Li) = {k} U {attributes of Si} and PK(Li) = k. • This option works for any specialization (total or partial, disjoint or over-lapping).

  4. Using method 8A

  5. 8B:Multiple relations-Subclass relations only • Create a relation Li for each subclass Si, 1 < i < m, • with the attributes Attr(Li) = {attributes of Si} U {k, a1 …, an} and • Primary Key (Li) = k. • This option only works for a specialization whose subclasses are total (every entity in the superclass must belong to (at least) one of the subclasses).

  6. Using Method 8B Tonnage

  7. 8C: Single relation with one type attribute • Create a single relation L • with attributes Attrs(L) = {k, a1, … an} U {attributes of S1} U…U {attributes of Sm} U {t} and Primary Key(L) = k. • The attribute t is called a type (or discriminating) attribute that indicates the subclass to which each tuple belongs

  8. Using Method 8C EngType

  9. 8D: Single relation with multiple type attributes • Create a single relation L • with attributes Attrs(L) = {k, a1, … an} U {attributes of S1} U…U {attributes of Sm} U {t1, t2,…,tm} and Primary Key (L) = k. • Each ti, 1 < I < m, is a Boolean type attribute indicating whether or not a tuple belongs to the subclass Si.

  10. Using Method 8D

More Related