Exp 2 Mapping EER To Relational Model Updated
Exp 2 Mapping EER To Relational Model Updated
.
1
Department of Computer Engineering
DBMS-2022-2023
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
Relational Model
In formal relational model terminology, a row is called tuple, a column header is called
an attribute, and table is called a relation. The data type describing the types of values
that can appear in each column is represented by a domain of possible values. Thus
Relation is set of tuples.
- Choose one of the key attributes of E as the primary key for the relation
- For each weak entity type W in the ER schema with owner entity type E,
create a relation R and include all attributes of the weak entity as
attributes of the new relation R.
- Then, include the primary key of the owner entity as foreign key
attributes of R
- The primary key of R is the combination of the primary key(s) of the
owner(s) and the partial key of the weak entity type W, if any.
2
Department of Computer Engineering
DBMS-2022-2023
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
- For each 1:1 relationship type identify the entities participating in the
relationship. There are two possible approaches below:
Choose one of the relations and include a foreign key in one relation (S)
which is the primary key of the other relation (T). It is better to choose
an entity type with total participation in the relationship in the role of S.
- For each regular 1:N relationship type R, identify the relation S, which
is the entity on the N-side of the relationship.
- Include as foreign key in S the primary key of the relation which is on
the 1 side of the relationship
- Include any simple attributes of the 1:N relation type as attributes of S.
- For each M:N relationship type, create a new relation S to represent the
relationship
3
Department of Computer Engineering
DBMS-2022-2023
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
-
Also include any simple attributes of the M:N relationship type as
attributes of S.
- The primary key attribute of the relation is the foreign key representing
the relationship between the entity and the multi-valued relation
- The primary key of R is the combination of A and K
- For each n-ary relationship type R, where n>2, create a new relation S to
represent the relationship.
- Include as foreign key attributes in S the primary keys of the relations
that represent the participating entities
- Also include any simple attributes of the n-ary relationship type as
attributes of S
4
Department of Computer Engineering
DBMS-2022-2023
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
5
Department of Computer Engineering
DBMS-2022-2023
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
6
Department of Computer Engineering
DBMS-2022-2023
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
Department of Computer
Engineering
DBMS-2022-2023
8
Department of Computer Engineering
DBMS-2022-2023
K. J. Somaiya College of Engineering, Mumbai-77
(A Constituent College of Somaiya Vidyavihar University)
Conclusion:
1. Draw the MENU entity as a supertype of the PROMOTIONAL, REGULAR, and OTHER entities.
The UID of MENU is code. MENU is related to FOOD ITEM through this relation-ship: each
MENU may contain one or more FOOD ITEMs, and each FOOD ITEM must be listed on one and
only one MENU. The UID of FOOD ITEM is a barred UID using its at-tribute “number”. Add
appropriate attributes to the each entity and draw a relational model for it
2. A field in a database table whose values are the same as the primary key of another table is
called:
A. A foreign key
B. A primary key
C. A secondary key
D. A candidate key
E. An alternate key
9
Department of Computer Engineering
DBMS-2022-23