CS 3430 Lecture Notes - Lecture 24: Foreign Key, Unique Key, Surrogate Key

31 views5 pages
83
Database Systems 3430 Chapter 9.2
Section 9.2 Mapping EER Model to RM
Reviewing Section 9.1
ER-to-Relational Mapping Algorithm
Step 1: Mapping of Regular Entity Types
Step 2: Mapping of Weak Entity Types
Step 3: Mapping of Binary 1:1 Relationship Types
Step 4: Mapping of Binary 1:N Relationship Types.
Step 5: Mapping of Binary M:N Relationship Types.
Step 6: Mapping of Multivalued attributes.
Step 7: Mapping of N-ary Relationship Types.
EER to RM
We add two more steps to the 9.1 Algorithm:
Step 8: Mapping of Specialization or Generalization.
Step 9: Mapping of Union Types (Categories).
Step 8: Mapping of Specialization or Generalization.
There are four options: 8A, 8B, 8C and 8D.
Option 8A: Multiple relations
Creating separate relations for all subclasses and superclass.
For the superclass, create a relation like step1 of the algorithm, let’s call it R1.
For each subclass, create a relation and add the primary key of R1 as foreign
key.
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 5 pages and 3 million more documents.

Already have an account? Log in
84
Database Systems 3430 Chapter 9.2
Example:
Option 8B: Multiple relations
Creating separate relations for subclasses only.
For each subclass, create a relation Ri.
Add all superclass attributes and its primary key to Ri.
Works only when superclass participation is total.
Because, otherwise, there would e soe istaes i superlass whih does’t fit
into any of subclasses.
We would lose their information with 8B mapping.
Example:
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 5 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents