Prepared by: JasmineA. Tulin
Conversion of entity types
• Create a relation R for each
entity type E, and include
all general attributes of E
as columns of R.
• Add only subcomponents
of attributes as columns of
R if they are composite
attributes.
• Specify one of the key
attributes of E as the
primary key or R
• Create a relation R for
multivalued attribute MA
which is in an entity type E.
PERSON
SSN
Name(First, Last)
Address
Birthdate
{Hobbies}
[Age]
3.
Prepared by: JasmineA. Tulin
Conversion of 1:1 relationship types
• Assume that the
two entity types
participating in a
relationship are S
and T.
• Add the primary
key of T as the
foreign key of S.
• Add all general
attributes of the
relationship to S.
NURSE
NurseID
NurseName
CENTER
CenterID
CenterLocation
4.
Prepared by: JasmineA. Tulin
Conversion of 1:N relationship types
• Assume that the two
entity types participating
in a relationship are S(N-
side) and T(1-side).
• Add the primary key of T
as foreign key of S.
• Add all general
attributes of the
relationship to S.
STUDENT
StudID
StudName
DEPARTMENT
DeptCode
DeptName
5.
Prepared by: JasmineA. Tulin
Conversion of M:N relationship types
• Assume that the two entity
types participating
relationship are S and T.
• Create a new relation R for
the relationship.
• Add all general attributes
of the relationship to R.
• Add the primary key of S
and T as foreign key of R.
• The primary key of R is a
combination of the foreign
key from S and the foreign
key from T.
STUDENT
StudID
StudName
SUBJECT
SubjectCode
Description
Units
6.
Prepared by: JasmineA. Tulin
Conversion of N-ary relationship types
(N > 2)
• Create a new relation R that
represents each N-ary relationship.
• Add all general attributes of the
relationship as columns of R.
• The primary key of all entities
participating in a relationship as
foreign key of R.
• The primary key of S is a
combination of all foreign keys. (If
the foreign key is from a relationship
with a cardinality of 1, it is not
included in the combination for the
primary key.)
STUDENT
StudID
StudName
SUBJECT
SubjectCode
Description
Units
TEACHER
TeacherID
Name
Section
Semester
SY
7.
Prepared by: JasmineA. Tulin
Conversion of generalized
relationships
• Create a table that represents each of the super entity types
and sub entity types.
• Add the primary keys of the tables representing super entity
types to the tables of sub entity types