ER Issue

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

DATABASE

MANAGEMEN
T SYSTEMS
ER Design
Issues
Overview

E R D e s i g nI s s u e
s.
In the previous section we understood:
- How to design a ER diagram?
- Different ways of identifying entity sets and their relationships.

Database Management
- Various representations of entity sets, attributes and relationships.

Systems
However, users often mislead the concept of the elements and the design
process of the ER diagram. Thus, it leads to a complex structure of the ER
diagram and certain issues that does not meet the characteristics of the
real-world enterprise model.

ER Design
Issues
Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University
ER Design Issues

In thissection we discuss the basic desi


gnissues while designing ER model.

1 Entity vs Attribute

Database Management
2 Entity vs Relationships

Systems
3 Binary vs Ternary Relationships

4 Placement of Relationship Attributes

ER Design
Issues
Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University
Entity vs Attributes

1 Entity vs Attributes
When to represent a value as an attribute?
When to represent a value as a separate entity-set?

Database Management
The structure of the real-world enterprise being simulated and the
semantics attached to its properties determine how an entity set or
attribute should be used. When a user uses the main key of one
entity set as an attribute of another, it results in an error.

Systems
Instead to make use of the connection to do so. Additionally, although
we identify it in the relationship sets, the main key characteristics are
implicit in the relationship set.

ER Design
Issues
Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University
Cont…

F_name

id name

Database Management
M_name

STUDENT

Systems
L_name

mobile
DOB

age

ER Design
mobile

Issues
STUDENT

Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University


Cont…

F_name

name M_name

mobile
L_name _no
id

Database Management
location
Std
STUDENT _
MOBILE

Systems
phn

type
DOB age

ER Design
Issues
Note: Representing as a separate entity-set allows details to be added later.
Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University
Cont…

Common Attribute Mistakes


Don’t include primary key attributes as descriptive attributes on
relationship-set.

Example: customer and loan relations again – IDs used as descriptive

Database Management
attributes on borrower.

l_no c_id

Systems
city
c_id amount

Customer
Studen borrower Loan
t

ER Design
C_name

Issues
pin

Association is contained by the relationship, so specifying


foreign key attributes is redundant.
Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University
Entity vs Relationship

2 Entity vs Relationship

It might be challenging to determine whether an entity set or


relationship set can best explain a given item. One must choose a
relationship set for expressing an activity that takes place between

Database Management
the entities in order to comprehend and decide on the appropriate
usage. It is best to keep the entity set separate from the object if
portraying it as a relationship set is necessary.

Systems
ER Design
Issues
Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University
Cont…

C_name
c_id city l_no c_id
amount
pin
Customer borrower Loan b_name

Database Management
Loan_br
anch BRANCH

assets

Systems
C_name
c_id city b_name
assets

city
pin Customer borrower BRANCH

ER Design
Issues
L_no amount

Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University


Binary vs. n-ary relationship set

3 Binary vs. n-ary relationship set

ER design can be complicated because to the n-ary relationships,


however we can transform and describe every n-ary relationship
using multiple binary relationships.

Database Management
COURSE

Systems
ER Design
TEACHER
Studen Relationship STUDENT

Issues
t

Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University


Cont…

TEACHER
Studen Relationship STUDENT
t

Database Management
TEACHER
Studen Relationship COURSE
t

Systems
STUDENT
Studen Relationship COURSE
t

ER Design
TEACHER
Studen teaches COURSE enroll STUDENT

Issues
t

Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University


Cont…

Common Attribute Mistakes


Ternary relationship between student, assignment, and submission.

Need to allow multiple submissions for a particular assignment, from a


particular student.

Database Management
ASSIGNMENT

Systems
ER Design
STUDENT
Studen Relationship SUBMISSION

Issues
t

Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University


Cont…

due_date
Sub_date
Sub_id
username data Short_name

Database Management
STUDENT
Studen submit SUBMISSION comple
te ASSIGNMENT
t

Systems
url

ER Design
Issues
Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University
Cont…

due_date
Sub_date
version
username data
Short_name

Database Management
STUDENT
Studen submit SUBMISSION complete ASSIGNMENT
t

Systems
url

Can also make submission a weak entity-set – Both student and


assignment are identifying entities.

ER Design
Discriminator for submission is version number.

Issues
Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University
Placement of Relationship Attributes

3 Placement of Relationship Attributes

The cardinality ratio of a relationship can affect the placement


of relationship attributes:
-One-to-Many: Attributes of 1:M relationship set can be repositioned

Database Management
to only the entity set on the many side of the Relationship.

- One-to-One: The relationship attribute can be associated with

Systems
either one of the participating entities

-Many-to-Many: Here, the relationship attributes can not be


represented to the entity sets; rather they will be represented by the
entity set to be created for the

ER Design
relationship set

Issues
Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University
Design Methodologies

The guidelines that should be followed while designing an ER diagram are


discussed below

1 Recognize entity sets.


2 Recognize relationship sets and participating entity sets.

Database Management
3 Recognize attributes of entity sets and attributes of relationship sets.
4

Systems
Define binary relationship types and existence dependencies.
5 Define general cardinality, constraints, keys, and discriminators.
Design diagram.

ER Design
Issues
Dr. Jay Sarraf, School of Computer Engineering, KIIT Deemed to be University

You might also like