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

Lecture 3c - Conceptual Data Modeling Excercise Cont

1) The document discusses developing an entity-relationship (E-R) diagram for a university database system. It provides examples of entities like school, department, professor, and relationships like belongs to, offers, and teaches. 2) The conceptual relational database schema represented as table structures is described for the university database with entities like school, professor, and course. 3) Additional details are provided about entities and attributes tracked for students, departments, courses, and grading.

Uploaded by

Hurair khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Lecture 3c - Conceptual Data Modeling Excercise Cont

1) The document discusses developing an entity-relationship (E-R) diagram for a university database system. It provides examples of entities like school, department, professor, and relationships like belongs to, offers, and teaches. 2) The conceptual relational database schema represented as table structures is described for the university database with entities like school, professor, and course. 3) Additional details are provided about entities and attributes tracked for students, departments, courses, and grading.

Uploaded by

Hurair khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Database 

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,…

• Example: We want to develop an E-R diagram for a "typical"


USA University:

1. The university is divided into different schools. Each one has


a Dean.

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)

3. Each department offers several courses.

1 M
DEPT offers COURSE
(1,N) (1,1)

4. A course have several sections.

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)

6. Each professor may teach up to 4 sections.


1 teaches
M
PROFESSOR SECTION
(0,4) (1,1)
Database Management Systems, Spring 2021, DCSE. 5
Example Cont…
7. Each student can take up to 6 courses. Each course has a
capacity of 35 students.

M ENROLL
M
COURSE STUDENT
(1,35) (1,6)

The relationship ENROLL between SECTION and STUDENT is


M:M, therefore, need an associative entity.

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)

9. Each student is advised by one professor, but a professor


may advise many students.

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:

1. SCHOOL (scode, sname, saddress, sphone , deanID)


foreign key (deanID) references DEAN (deanID) 

2. DEAN (deanID, deanName, deanPhone)

3. DEPT (deptNum, deptPhone, deptAddress, scode, chair)


foreign key (scode) references SCHOOL (scode)
foreign key (chair) references PROFESSOR (facID)
chair is the facID of the chairperson of the department
Database Management Systems, Spring 2021, DCSE. 10
Example Cont…
4. PROFESSOR (facID, SSN, name, address, phone, salary,
deptNum)
foreign key (deptNum) references DEPT (deptNum) 

5. COURSE (courseNum, courseName, credit, deptNum)


foreign key (deptNum) references DEPT (deptNum) 

6. SECTION (callNum, courseNum, facID, days, time, location)


foreign key (courseNum) references COURSE (courseNum)
foreign key (facID) references PROFESSOR (facID)

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) 

8. ENROLL (sID, courseNum, grade)


foreign key (sID) references STUDENT (sID)
foreign key (courseNum) references COURSE (courseNum)

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.

• Each department is described by name, department code, office


number and office phones. Both name and code have unique values
for each department.

• Each course has a course name, description, code number, number


of semester hours and offering department. The value of the code
number is unique for each course.

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.

• A grade report has a student, module and grade.

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

You might also like