ER Model
ER Model
MANAGEMENT
SYSTEM
Contents
E-R Model
• It develops a conceptual design for the database. It also develops a very simple
and easy to design view of data.
8
Degree-2(binary)
E1 1
E2 2
D1
E3 3
E4 4
D2
E5 5
E6 6
D3
Employee Department
Works for
9
ER
DIAGRAM
N 1
Work For Department
Employee
Min/Max Representation
(1,1) (0,N)
Employee Work For Department
Degree-2(binary)
E1
1 P1
E2 2 p2
3 p3
E3 4 P4
5
E4
11
(1,M) (1,N)
Employee Works_On Project
12
Requirement Analysis:
Every Department should have a manager & only one employee manages a department.
Degree-2(binary)
E1
1 D1
E2 2 D2
3 D3
E3 4 D4
E4
E5 13
(0,1) (1,1)
Employee Manages Department
14
RECURSIVE RELATIONSHIP
Employee (as Supervisor)
Supervises Employee (as
Supervisee)
Sup
ervi
1
ses
2
E1 3 E1
supervisor supervisee E2 E2
E3 E3
E4 E4
1 Employee N
(0,N) (0,1)
15
WEAK ENTITY SET
16
CONSTRUCTING AN E-R MODEL
Before beginning to draw the ER model, read the
requirements specification carefully.
Document any assumptions you need to make.
1. Identify entities
• list all potential entity types. These are the
object of interest in the system. It is better to
put too many entities at this stage and then
discard them later if necessary.
17
2. REMOVE DUPLICATE
ENTITIES
• Ensure that they really separate entity types or just
two names for the same thing
• Also do not include the system as an entity type
• e.g. if modelling a library, the entity types might be
books, borrowers, etc.
18
3. LIST THE ATTRIBUTES OF EACH
ENTITY
• Ensure that the entity types are really needed.
• Are any of them just attributes of another entity type?
• If so keep them as attributes and cross them off from
the entity list.
19
4.MARK THE PRIMARY
KEYS
• Which attributes uniquely identify instances of
that entity type?
• This may not be possible for weak
entities.
o A professor can teach more than one courses and also a course can
be taught by more than one professors.
23
1. IDENTIFY THE ENTITIES
College
Department
Courses
Faculty
Student
Progress_report
24
2. REMOVE DUPLICATES ENTITIES
In this example we didn’t find any duplicate entity so go
for the next step.
25
3. IDENTIFY THE ATTRIBUTES OF EACH
ENTITY
o College – c_id, c_name, contact_no, c_address .
o Department – d_id, d_name, contact_no, Hod_id.
o Courses – course_no, course_title, year.
o Faculty – F_id, F_name, Designation, qualification,
contact_no, Address.
o Student – S_id, name, year, contact_no, Address.
o Progress_report – report_id, year, grade, rank.
26
4. MARK THE PRIMARY KEY FOR EACH
ENTITY
o College – c_id
o Department – d_id
o Courses – course_id
o Faculty – F_id
o Student – S_id
o Progress_report – report_id
27
5. IDENTIFY THE RELATIONSHIP AMONG THE
ENTITIES
o College – Department
o Department – Faculty
o Faculty – Courses
o Department – Courses
o Department – Student
o Student – Progress_report
28
6. DESCRIBES THE CARDINALITY AMONG
THE ENTITIES
30
C_id Name Address
1 N 1 N
College has Department Offers Course
1 N
1
Contact_
No
Enroll has
Teaches
N
Student N M
1 Faculty
Stud_Report
31
N
Progress_Report
MAKE AN E-R MODEL OF ONLINE SALES FOR
BIGHIT VIDEO
“ BigHit Video Inc. wants to create an information system
for online sales of movies in both DVD and videotape format.
People will be allowed to register as customers of the online site
and to update their stored information. Informa-tion must be
maintained about customers ’ shipping addresses, e-mail ad-
dresses and credit cards. In a single sale, customers will be
allowed to purchase any quantity of videos. The items in a
single sale will be shipped to a single address and will have a
single credit card charge A customer will be provided with a
virtual shopping cart to store items to be purchased. As each
item is selected, it is added to the shopping cart. When the
customer finishes shopping, he will be directed to a checkout
area where he can purchase all of the items in the shopping
cart. At this time, payment and shipping information is entered.
Once the sale is complete, the shopping cart will be deleted and 32
the customer will be sent a receipt by e-mail.”
THANKS