0% found this document useful (0 votes)
14 views

ER Model Steps in Database Design Process Entities, Attributes, and Associations ER Notations

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

ER Model Steps in Database Design Process Entities, Attributes, and Associations ER Notations

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Lecture Session-2

Conceptual Database Design (ER Modeling)


Ch. 3

Content

❑ ER Model
❑ Steps in Database Design Process
❑ Entities, Attributes, and
Associations
❑ ER Notations

1 Database Design & Applications


Major Steps in
Database Design
Process
Step 1: Requirement analysis
Understanding the domain
Identifying the data to be stored
Identifying the constraints
Step 2: Conceptual Database design
E-R modeling/UML
Step 3: Logical Database Design
Designing tables and relationships
Step 4: Refinement of schema
Step 5: Physical database design
❑ Indexing
❑ Clustering
❑ Storage formats
2 Database Design & Applications
ER
Modeling
ER Model is a popular high-level (conceptual) data
model.
It is an approach to designing Semantic Conceptual
schema of a Database.
ER model allows us to describe the data involved in
a real-world environment in terms of objects and
their relationships, which are widely used in design
of database.
ER model provides preliminary concepts or idea
about the data representation which is later modified
to achieve final detailed design.
3 Database Design & Applications
ER
Modeling
Important concepts/notions used in ER modeling are-

Entity is an object in real-world or some idea or


concept which can be distinguished from other objects.
Ex.: person, school, class, department,
weather, salary, temperature etc.
Entity has independent existence.

Each entity belongs to an Entity type that defines the


structure.

Entity Set is a Collection of similar objects.

4 j Database Design & Applications


Concepts used in
ER
Attribute: reflects a property of an object or entity. We have following
types of attributes.
> Simple attribute
> Composite attribute
> Single valued attribute
> Multi-valued attribute
> Derived attribute
> Stored attribute
Candidate Key (simply called a key): Is an Attribute of an entity type
whose value can uniquely identify an entity in a set.

Primary key: one of the candidate keys can become PK of an entity type.

Alternate keys: The candidate keys other than the PK, are known as
alternate keys.

5 Database Design & Applications


Concepts used in
ER

Relationship: The association between entities is


known as relationship.

Domain of an attribute: The set of possible values is


known as domain of an attribute

6 Database Design & Applications


Notations used in
ER
Notations used in ER modeling are shown
below. Entity Type

Weak Entity Type

Relationship Type

Identifying Relationship type

Attribute

7 Database Design & Applications


Notations used in
ER

Key Attribute

Multivalued Attribute

Composite Attribute

Derived Attribute

8 Database Design & Applications


Notations used in
ER
E R
Total Participation of E1 in R
1
E2

1 N Cardinality ratio 1; N for E1; E2 in R


E1 R E2

(min, max) Structural Constraint (min, max) on


R E Participation of E in R

9 Database Design & Applications


Relationships in
ER
Relationships

Manager Manages Employee

Manages
Manager Employee

Degree of a Relationship
Manages
• If there are two entity types involved it is a binary relationship Manager Employee
type

• If there are three entity types involved it is a ternary relationship


type Sales Sell
Produ
s
Assista ct
nt

• Unary relationships are also known as a recursive relationship Custom


er
Manages

Employee

• It is possible to have n-ary relationship (e.g. quaternary or


unary)
10 Database Design & Applications
Relationships in
ER
Cardinality of a relationship
Relationships are rarely one-to-one.
For example, a manager usually manages more than one
employee. This is described by the cardinality of the relationship,
for which there are four possible categories.

1 is married to 1
Man Women
One to one (1:1) relationship
1 Manages m
Manager Employee
One to many (1:M) relationship

m 1
Studies
Student Course
Many to one (M:1) relationship

m n
Teaches
Lecturer Student
Many to many (M:N) relationship

11 Database Design & Applications


Relationships in
ER
Participation Constraint

If all the entities of an entity type are involved in the relationship then that entity type’s
involvement said to be total in that relationship. In the below relationship if each employee is
associated with at least one dept. Then the participation of EMP is total. Here, EMP works
for DEPT.
If, only few entities of the set are involved the participation is partial.

E R
1
E2
EMP DEPT Association Role:
Worker Employer

* 1
Multiplicity
EMP DEPT

Association Name & Direction:


Works_for
EMP DEPT

12 Database Design & Applications


ER Diagram for the Company DB
schema, with all role names
Mint LName
FName Number
Address Works_for

Sex (1, 1) (4, N) Name


Location
Name Salary
Employee department

Ssn EMPLOYEE Number of DEPARTMENT


(0, 1) Employees
Start Date
Bdate Manager (1, 1)
Controlling (0, N)
(0, N) department
MANAGES
(0, 1)
Supervisor Supervisor Hours
CONTROLS

SUPERVISION
(0, N) WORKS_ON
Controlled
Employee (1, 1)
(1, N) project
Project
PROJECT
DEPENDENTS_OF

Name

Dependent Number
(1, 1)
Location

DEPENDENT

Relationship
Name Sex Bdate

13 Database Design & Applications


Exercis
e
Assume that we need to capture the data about the River systems in our country.
Description is as follows.
i) Capture the facts about rivers; like- name(unique), length, average flow, type.
ii)Capture info about states- name(unique), area, capital, population, CM, cities
with more than 10 lakhs population.
iii) Projects details- name(unique), year, category, exp in Rs.Cr.
iv) A river may be a tributary of other river. A river may have zero to many
tributaries.
v) A project will belong to only one state and is built on only one river.
vi) A state may have zero to any number of projects.
vii) A river can have zero to many projects.
viii) A river flows through one or more states.
ix) A state can have zero or more rivers.

Now draw an ER diagram for the above requirement. Assume necessary data
which is missing in the question. The ER model should include- relationships,
max,
min- cardinality, participation conditions
14 Database Design & Applications
Summary
✔ Various steps in Database Design Process
✔ What is ER Modeling
✔ Concepts and notations used in ER
✔ Representing Constraints in ER Modeling
✔ Exercise

Database Design & Applications

You might also like