



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
"Description about EERD To Relational Schema Mapping, Design Methodology, conceptual, logical, and physical design, Examples,Multi Subclasses, Options for mapping."
Typology: Study notes
1 / 7
This page cannot be seen from the preview
Don't miss anything!




26/02/2008 Lecture_4 / MappingIntoRel 2
26/02/2008 Lecture_4 / MappingIntoRel 3
26/02/2008 Lecture_4 / MappingIntoRel 4
26/02/2008 Lecture_4 / MappingIntoRel 5
26/02/2008 Lecture_4 / MappingIntoRel 6
Step 2
the parent entity and the identifier of the
weak or dependent entity (i.e. a composite
PK)
26/02/2008 Lecture_4 / MappingIntoRel 7
PK).
Step 2 / Cont.
EMPLOYEE (FNAME, MINT,
LNAME, SSN, BDATE,
ADDRESS, SEX, SALARAY)
DEPARTMENT (DNAME,
26/02/2008 Lecture_4 / MappingIntoRel 8
( ,
DNUMBER)
PROJECT (PNAME, PNUMBER,
PLOCATION)
DEPENDENT (ESSN, DEPENDENT_NAME, SEX, BDATE)
F.K.
Step 3
hierarchy, in our sample model, we skip
Step 3 at this stage. We will cover it later
26/02/2008 Lecture_4 / MappingIntoRel 9
EMPLOYEE (FNAME, MINT, LNAME, SSN, BDATE, ADDRESS,
SEX, SALARAY) DEPARTMENT (DNAME, DNUMBER)
PROJECT (PNAME, PNUMBER, PLOCATION)
DEPENDENT (ESSN, DEPENDENT_NAME, SEX, BDATE)
Step 4
Binary 1:
relationship
type mapped to
a foreign key
26/02/2008 Lecture_4 / MappingIntoRel 10
a foreign key
from one
relation
referring to the
other relation.
Step 4 / Cont
EMPLOYEE (FNAME, MINT,
LNAME, SSN, BDATE,
PROJECT (PNAME, PNUMBER,
PLOCATION)
26/02/2008 Lecture_4 / MappingIntoRel 11
LNAME, SSN, BDATE,
ADDRESS, SEX, SALARAY)
DEPARTMENT (DNAME, DNUMBER,
DEPENDENT (ESSN,
DEPENDENT_NAME, SEX,
BDATE)
MgrSSN, MgrStartDate)
Step 4 / Cont.
Partial vs. Total participation determines the placement
of the linking attribute.
26/02/2008 Lecture_4 / MappingIntoRel 12
Create a new linking table (i.e. treat the relationship as
N:M relationship) in the following cases:
If historical data is required.
If the relationship has many attributes associated
with it.
Step 3/ Multi Subclasses
are four different possibilities, depends on
Business Rules (Constraints).
Di j i t O ti l
26/02/2008 Lecture_4 / MappingIntoRel 19
Step 3/ Options for mapping
Option 1: Multiple Relations – Superclass & subclasses
Works for any specialization (total or partial, disjoint or
overlapping)
Option 2: Subclass relation only
For total disjoint specialisation
26/02/2008 Lecture_4 / MappingIntoRel 20
Option 3: Single relation with one type attribute
For disjoint specialisation that potentially generating many
NULL values.
Option 4: Single relation with multiple type attributes
Boolean type attribute for overlapping specialization (also
work for disjoint)
Step 3 / Option 1 / Example
Disjoint Optional
Employee
d
TypingSpeed TGrade EngType
SSN
26/02/2008 Lecture_4 / MappingIntoRel 21
SECRETARY TECHNICIAN ENGINEER
EMPLOYEE (SSN, FNAME, MINT, LNAME, ...)
SECRETARY (SSN, TYPINGSPEED)
TECHNICIAN (SSN, TGRADE)
ENGINEER (SSN, ENGTYPE)
Step 3 / Option 1 / Steps
Disjoint Optional
identify a PK for it;
C t l ti f h b l
26/02/2008 Lecture_4 / MappingIntoRel 22
Its PK is the same as the one for the
Superclass entity.
subclass.
Step 3 /Option 2 / Example
Disjoint Mandatory (total)
Employee
d Salary PayScale
SSN
26/02/2008 Lecture_4 / MappingIntoRel 23
SALARIED_EMPLOYEE (SSN, SALARY,...) TRADE_
UNION
HOURLY_
EMPLOYEE
SALARIED_
EMPLOYEE
M GS_TO
1
HOURLY_EMPLOYEE (SSN, PAYSCALE,...)
Step 3 /Option 2 / Steps/
Disjoint Mandatory
(no relation for the superclass) with the
same PK you have chosen earlier for the
26/02/2008 Lecture_4 / MappingIntoRel 24
y
superclass.
appropriate subclass.
Step 3 /Option 3 / Example
Overlapping Optional (partial)
Employee
O
TypingSpeed TGrade EngType
SSN
26/02/2008 Lecture_4 / MappingIntoRel 25
SECRETARY TECHNICIAN ENGINEER
EMPLOYEE (SSN, FNAME, MINT, LNAME, …,
JobType_Participation_Occ,
TYPINGSPEED, TGRADE, ENGTYPE)
Alternative approach (2 tables):
EMPLOYEE (SSN, FNAME, MINT, LNAME, …,
EMP_JOB (SSN, TYPINGSPEED, TGRADE, ENGTYPE)
Step 3 /Option 3 / Steps
Overlapping Optional
superclass and all its subclasses.
to specify class membership.
26/02/2008 Lecture_4 / MappingIntoRel 26
occurrences of the superclass in the subclasses.
or with other entities.
Step 3 /Option 4 / Example
Overlapping Mandatory
PART
O
ManufactureDate
SupplierName
PartNo
Description
DrawingNo
Li P i
BatchNo
26/02/2008 Lecture_4 / MappingIntoRel 27
PART (PartNo, Description,
PURCHASED
_PART
MANUFACTURED
_PART
ListPrice
PFlag, SupplierName, ListPrice)
MFlag, DrawingNo, ManufactureDate, BatchNo,
Single relation
with multiple
Boolean type
attribute
Step 3 /Option 4 / Steps
Overlapping Mandatory
superclass and all its subclasses.
attribute to specify class membership.
If the flag is “on” for a specific subclass means
26/02/2008 Lecture_4 / MappingIntoRel 28
that the superclass has a specialisation.
As in Option 3
Treated as Disjoint Optional (option 1)
Recap (3 rd^ part of lecture…after break)
relational schema by following a set of
steps.
f
26/02/2008 Lecture_4 / MappingIntoRel 29
looking at alternative way of mapping CDM
into a relational schema.
Alternative Mapping procedure:
Simplifying the Conceptual model
model that are not compatible with the relational
model.
mapping that we covered earlier in this lecture.
26/02/2008 Lecture_4 / MappingIntoRel 30
Relational Model)
Summary
Mapping CDM into a Relational Schema can
be applied directly on the CDM by following
the 7 systematic steps.
OR
26/02/2008 Lecture_4 / MappingIntoRel 37
OR
CDM can be simplified to make it one step
closer to the Relational model and then
map according to steps into a Relational
Schema.