Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mappings & Normal Form Guarantees. Can Mappings of Diagrams Yield Normalized Schemas? “Yes”—but only if canonical. Most (?) diagrams are canonical. Mappings.

Similar presentations


Presentation on theme: "Mappings & Normal Form Guarantees. Can Mappings of Diagrams Yield Normalized Schemas? “Yes”—but only if canonical. Most (?) diagrams are canonical. Mappings."— Presentation transcript:

1 Mappings & Normal Form Guarantees

2 Can Mappings of Diagrams Yield Normalized Schemas? “Yes”—but only if canonical. Most (?) diagrams are canonical. Mappings created to make this so. Many argue that if a conceptual-model diagram is not canonical, it is not a good quality diagram.

3 Canonical ER Diagrams Attributes atomic No FDs among attributes (except when the lhs is a key for an entity or relationship set) Non-binary relationship sets fully reduced No redundant relationship sets “such that the mapping yields a normalized schema”

4 Non-Canonical ER Diagram Type  RackRate RoomNr Date  GuestNr Rate Discount Date  Discount Rate = (1 – Discount/100)  RackRate Includes =  Package,Description (Has |  | IsSignedUpFor) IsSignedUpFor =  GuestNr,Description (Has |  | Includes) HasReservationFor = |  |(Package GuestNr, GuestNr Description, RoomNr Date GuestNr Discount Rate) includes has Room RoomNr Rate has reservation for Guest is signed up for Activity Name Description Duration Date NrInParty Type Rack Rate Discount PackageDeal GuestNr Package not atomic FD among attributes not reduced redundant relationship set

5 Map—Then Normalize Not 1NF: Name not atomic Not 2NF: Date  Discount Not 3NF: Type  RackRate Not PJNF: |  |(Package GuestNr, GuestNr Description, RoomNr Date GuestNr Rate Discount) Room(RoomNr, Type, RackRate) Guest(GuestNr, Name, NrInParty, Package) Activity(Description, Duration) HasReservationFor(RoomNr, Date, GuestNr, Rate, Discount, Package, Description) IsSignedUpFor(GuestNr, Description) Includes(Package, Description)

6 Map—Then Normalize Not 1NF: Name not atomic Not 2NF: Date  Discount Not 3NF: Type  RackRate Not PJNF: |  |(Package GuestNr, GuestNr Description, RoomNr Date GuestNr Rate Discount) Room(RoomNr, Type) RoomType(Type, RackRate) Guest(GuestNr, FirstName, LastName, NrInParty, Package) Activity(Description, Duration) HasReservationFor(RoomNr, Date, GuestNr, Rate) DateDiscount(Date, Discount) Includes(Package, Description) redundant: subsumed in Guest |  | Includes

7 Normalize—Then Map Type  RackRate RoomNr Date  GuestNr Rate Discount Date  Discount Rate = (1 – Discount/100)  RackRate Includes =  Package,Description (Has |  | IsSignedUpFor) IsSignedUpFor =  GuestNr,Description (Has |  | Includes) HasReservationFor = |  |(Package GuestNr, GuestNr Description, RoomNr Date GuestNr Discount Rate) includes has Room RoomNr Rate has reservation for Guest is signed up for Activity Name Description Duration Date NrInParty Type Rack Rate Discount PackageDeal GuestNr Package not atomic FD among attributes not reduced redundant relationship set Fix the problems in the diagram, then map.

8 Normalize—Then Map RoomNr Date  GuestNr Rate Rate = (1 – Discount/100)  RackRate includes has Room RoomNr Rate has reservation for Guest Activity Name Description Duration Date NrInParty Rack Rate Discount PackageDeal GuestNr Package has Room Type Type Date Discount LastNameFirstName

9 Normalize—Then Map RoomNr Date  GuestNr Rate Rate = (1 – Discount/100)  RackRate includes has Room RoomNr Rate has reservation for Guest Activity Name Description Duration Date NrInParty Rack Rate Discount PackageDeal GuestNr Package has Room Type Type Date Discount LastNameFirstName Room(RoomNr, Type) RoomType(Type, RackRate) Guest(GuestNr, FirstName, LastName, NrInParty, Package) Activity(Description, Duration) DateDiscount(Date, Discount) HasReservationFor(RoomNr, Date, GuestNr, Rate) Includes(Package, Description)


Download ppt "Mappings & Normal Form Guarantees. Can Mappings of Diagrams Yield Normalized Schemas? “Yes”—but only if canonical. Most (?) diagrams are canonical. Mappings."

Similar presentations


Ads by Google