You are on page 1of 4

EX NO:3

DATE:
RELATIONAL DATABASE DESIGN USING ER
TO RELATIONAL MAPPING
AIM
To have a relational mapping for the constructed ER diagram on e-Jurisdiction

RELATIONAL DATABASE DESIGN USING ER DIAGRAM TO


RELATIONAL MAPPING

1. Mapping of Regular Entity Types


2. Mapping of Weak Entity Types
3. Mapping of Binary 1:1 Relationship
4. Mapping of Binary 1:N Relationship
5. Mapping of Binary N:M Relationship
6. Mapping of Multivalued Attributes
7. Mapping of N-ary Relationship types

MAPPING OF REGULAR ENTITY TYPES


For every regular (Strong) entity a table is created
1. Include all the simple attributes.
2. If Composite attributes are present add only the simple attributes of the composite
attributes
3. Decide the primary key.

Advocate(advo_id, fname, ,minit, lname, years, speciality)

LNAME MINIT
FNAME

YEARS
ADVOCATE

ADVO_ID

SPECIALITY

Plaintiff (p_id ,fname ,minit ,lname ,DOB)

FNAME MINIT

P_ID
PLAINTIFF
LNAME

DOB
Judge(j_id, fname, minit, lname, years, nature)

FNAME MINIT
LNAME

P_ID
JUDGE
NATURE

YEARS

TABLES:
 Advocate(advo_id, fname, ,minit, lname, years, speciality)
 Plaintiff (p_id ,fname ,minit ,lname ,DOB)
 Judge(j_id, fname, minit, lname, years, nature)

MAPPING OF WEAK ENTITY TYPES


For every Weak Entity,
1. Create a table
2. Include all simple attributes
3. Add the primary key of the owner entity as a foreign key in the relation
4. Primary Key: Primary Key of Owner + Discriminator

MAPPING OF BINARY 1:1 RELATIONSHIP


For each 1:1 binary relationship, find the relation that participates corresponding to the entity
types
• Foreign Key approach
• Merged Relation approach
• Cross reference approach
Foreign Key approach should be used until some special cases arise

Foreign Key Approach


1. Identify the two entities participating in the relation
2. Choose any one entity
It is better to choose the entity with total participation. (S)
• Primary Key of T is added as the foreign key of S
• Add all the Simple attributes of the relation as attributes of S
C_ID DESCRIPTION COURT_ID

LOCATION
LOC

CASE PRESENT COURT

TYPE
TYPE
DATE NUMBER

Court( Court_ID, location, type, number,date)

Merged Relation Approach


1. Merge 2 entity types and relation into a single relation
2. This can be done when both the entity participation are total

Cross Reference Approach


3rd relationship is setup for the purpose of cross referencing the primary keys of the 2 entities (S
and T)

MAPPING OF BINARY 1:N RELATIONSHIP


1. Identify the 1:N relationship.
2. Identify the entity that belongs to cardinality N.
3. Add the primary key of other entity as a foreign key in table that belongs to the entity of
cardinality N

TABLES:
 Court( Court_ID, location, type, number,date, c_id)
 Plaintiff (p_id ,fname ,minit ,lname ,DOB, c_id)
 Advocate(advo_id, fname, ,minit, lname, years, speciality, c_id)

MAPPING OF BINARY N:M RELATIONSHIP


1. Create new relation.
2. Primary Keys of both the entities are added in this new relation
3. Any simple attributes of the relation is added to the table
MAPPING OF MULTIVALUED ATTRIBUTES
1. For each multivalued attribute a new table is created.
2. The table contains attributes corresponding to the multivalued attributes
3. Primary of the entity to which the multivalued attribute belongs to is added to this table

COURT_ID P_ID
LOC PH_NO

COURT PLAINTIFF

TABLES:
 Court(court_id, loc)
 Plaintiff(p_id, phone_no)

MAPPING OF N-ARY RELATIONSHIP TYPES


1. Create new relation.
2. Primary Keys of all the entities are added in this new relation
3. Any simple attributes of the relation is added to the table

LIST OF TABLES:
 Court( Court_ID, location, type, number,date, c_id)
 Plaintiff (p_id ,fname ,minit ,lname ,DOB, c_id)
 Advocate(advo_id, fname, ,minit, lname, years, speciality, c_id)
 Judge(j_id, fname, minit, lname, years, nature)
 Case(c_id, type, description)

RESULT:
Thus the relational mapping for e-Jurisdiction system is done

You might also like