Lecture 3c - Conceptual Data Modeling Excercise Cont
Lecture 3c - Conceptual Data Modeling Excercise Cont
Management Systems
Sumayyea Salahuddin (Lecturer)
Dept. of Computer Systems Eng.
UET Peshawar
Overview
• Data modeling in organization cont.
Database Management Systems, Spring 2021, DCSE. 2
Developing an E‐R Diagram
• The development of an E-R diagram is an iterative process
that involves designers and end users. It is based on
interviews, reports, business forms,…
1 1
SCHOOL runs DEAN
(1,1) (1,1)
Database Management Systems, Spring 2021, DCSE. 3
Example Cont…
2. Each school is composed of several departments.
1 belongs M
SCHOOL to DEPT
(1,N) (1,1)
1 M
DEPT offers COURSE
(1,N) (1,1)
1 M
COURSE has SECTION
(1,N) (1,1)
Database Management Systems, Spring 2021, DCSE. 4
Example Cont…
5. Each department may employs several professors, but each
professor belongs to a single department. Each department
is chaired by a chair, who is also a professor.
employs
1
DEPT
(0,N)
1 (1,1)
M (1,1)
1
PROFESSOR chairs
(0,1)
M ENROLL
M
COURSE STUDENT
(1,35) (1,6)
Database Management Systems, Spring 2021, DCSE. 6
Example Cont…
8. Each department has several student majoring in that
department. But each student has one major.
1 M
DEPT has STUDENT
(1,N) (1,1)
1 advises
M
PROFESSOR STUDENT
(0,N) (1,1)
Database Management Systems, Spring 2021, DCSE. 7
Example Cont…
• The database for the university includes 7 entities:
SCHOOL, DEAN, DEPT, PROFESSOR, COURSE,
SECTION, and STUDENT
Relationship Relation 1 Relation 2
• It includes 10 belongs to school department
runs dean school
relationships:
employs department professor
offers department course
has department student
contains course section
teaches professor section
advises professor student
chairs professor department
enrolls student section
Database Management Systems, Spring 2021, DCSE. 8
Example Cont…
Database Management Systems, Spring 2021, DCSE. 9
Example Cont…
• The conceptual Relational Database schema (E-R model
represented in the form of table structure) for the university
is:
Database Management Systems, Spring 2021, DCSE. 11
Example Cont…
7. STUDENT (sID, SSN, name, address, major, deptNum,
advisor)
foreign key (deptNum) references DEPT (deptNum)
foreign key (advisor) references PROESSOR (facID)
Database Management Systems, Spring 2021, DCSE. 12
Example
• The university keeps track of each student's name, student number,
current address, permanent address and phone, birthdate, gender,
year of study (1st, 2nd, 3rd, 4th ), major department, minor
department (if any), and degree program (B.A., B.Sc., ..., Ph.D.).
Some user applications need to refer to the city, county, and post
code of the student's permanent address and to the student's last
name.
Database Management Systems, Spring 2021, DCSE. 13
Example Cont…
• Each module has an instructor, semester, year, course and
module number. The module number distinguishes different
modules of the same course that are taught during the same
semester/year; its values are 1, 2, 3, ..., up to the number of
modules taught during each semester.
Database Management Systems, Spring 2021, DCSE. 14
Summary
• Learn how to model E-R diagram, entities selection,
relationships and cardinalities assignment
Database Management Systems, Spring 2021, DCSE. 15