Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Design with Semantic Object Models zMapping 7 types of semantic objects into relations.

Similar presentations


Presentation on theme: "Database Design with Semantic Object Models zMapping 7 types of semantic objects into relations."— Presentation transcript:

1 Database Design with Semantic Object Models zMapping 7 types of semantic objects into relations

2 Simple objects zTransform object into relation zMake ID into key zOther attributes become columns

3 Composite objects zOne relation for base object yInclude single-valued attributes zOne relation for each (simple or group) multi- valued attribute zKey of child relation is composite: yForeign key of object yLocal key of multi- valued attribute

4 Separate versus nested groups zIterate composite object procedure zOuter group is base object for inner group

5 Compound objects zBasically 3 types of binary relationships

6 Compound objects z1:1 - place key of either table into other table

7 Compound objects z1:N - place key of parent into child table

8 Compound objects zN:M - create intersection table with keys of both relations

9 Hybrid objects zCreate a table for the multi-valued group attribute of the composite object zPlace key of non-composite object into that table SALES-ORDER (SalesOrderNumber, Date, Subtotal, Tax, Total, Phone, SalespersonName) ITEM (ItemNumber, ItemDescription, UnitPrice) LINE-ITEM (SalesOrderNumber, ItemNumber, Quantity, ExtendedPrice)

10 Hybrid objects zActually, 4 cases of hybrid objects

11 Hybrid Object Max Cardinality zCase One zITEM in one ORDER and only one LineItem

12 Hybrid Object Max Cardinality zCase Two zITEM in one or more LineItems within one SALES-ORDER

13 Hybrid Object Max Cardinality zCase Three zITEM in one LineItem within one SALES- ORDER

14 Hybrid Object Max Cardinality zCase Four zITEM in one or more LineItems within one SALES-ORDER

15 Hybrid object common cases zCase 4: O3 is inserted into R-G2 but not as part of its local key zCase 1: like 3 but add O1 to R2 and R2(O1,O2) = R-G1(O1,O2)  Case 2: like 4 but add O1 to R3 and R-G2(O1,O3)  R3(O1,O3)

16 Association objects zOne relation for each of the 3 participating objects yEach relation has its own key yAssociation relation has parents’ keys as foreign keys yIf association has no unique ID, use foreign keys zUnlike intersection relations, association tables may have additional attributes

17 Super/subtype objects zOne table for parent zOne table for each subtype zNormally same key for all zMay add subtype attribute(s) to parent for efficiency yOne label if exclusive yOne Boolean per type, if not exclusive

18 Archetype/version objects zOne table for archetype zOne table for version zKey of version table contains key of archetype table


Download ppt "Database Design with Semantic Object Models zMapping 7 types of semantic objects into relations."

Similar presentations


Ads by Google