0% found this document useful (0 votes)
14 views19 pages

DBMS Lecture 3 Developing An ER Diagram

The document outlines the iterative process of developing an Entity-Relationship Diagram (ERD) for a database design, emphasizing the importance of creating a detailed narrative, identifying business rules, and revising the ERD through reviews. It provides a case study of Tiny College, detailing its organizational structure, including schools, departments, courses, classes, and relationships among professors, students, and departments. The document highlights the complexity of relationships and the need for careful consideration of optional entities and attributes in the ERD.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views19 pages

DBMS Lecture 3 Developing An ER Diagram

The document outlines the iterative process of developing an Entity-Relationship Diagram (ERD) for a database design, emphasizing the importance of creating a detailed narrative, identifying business rules, and revising the ERD through reviews. It provides a case study of Tiny College, detailing its organizational structure, including schools, departments, courses, classes, and relationships among professors, students, and departments. The document highlights the complexity of relationships and the need for careful consideration of optional entities and attributes in the ERD.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Lecture 3: Developing an ER Diagram

Dr Tran Duc Minh and Dr Hung


Tran

DATCOM Lab
Faculty of Data Science and Artificial
Intelligence College of Technology, National
Economics University Email:
[email protected], [email protected]

September 19, 2024


DATCOM Lab (DATCOM Lab) September 19, 1 / 19
Outlin
e

Overview
2 Tiny
College

DATCOM Lab (DATCOM Lab) September 19, 2 / 19


Overvie
w

Overview

The process of database design is iterative rather than


a linear or sequential process.
An iterative process is based on repetition of
processes and procedures.
Building an ERD usually involves the following
activities:
▶ Create a detailed narrative of the organization’s
description of operations.
▶ Identify the business rules based on the description of

operations.
▶ Identify the main entities and relationships from the

business rules.
▶ Develop the initial ERD.

▶ Identify the attributes and primary keys that adequately

describe the entities.


DATCOM Revise and
Lab) review the ERD.

Lab (DATCOM September 19, 3 / 19
Overvie
w

Overview
During the review process, additional objects, attributes, and
relationships probably will be uncovered.
The basic ERM will be modified to incorporate the newly discovered
ER components.
Another round of reviews might yield additional components or
clarification of the existing diagram.
The process is repeated until the end users and designers agree that
the ERD is a fair representation of the organization’s activities and
functions.
During the design process, the database designer does not depend
simply on interviews to help define entities, attributes, and
relationships.
▶ A surprising amount of information can be gathered by examining the
business forms and reports that an organization uses in its daily
operations.
DATCOM Lab (DATCOM Lab) September 19, 4 / 19
Tiny
College

The interview
process
1 Tiny College (TC) is divided into several schools:

business, arts and sciences, education, and applied


sciences.
▶ Each school is administered by a dean who is a professor.
▶ Each professor can be the dean of only one school, and a
2 professor is not required to be the dean of any school.
Each school comprises several departments. Each
department belongs to only a single school.

DATCOM Lab (DATCOM Lab) September 19, 5 / 19


Tiny
College

The interview
process
3 Each department may offer courses.
▶ Tiny College had some departments that were classified
as ”research only,” they would not offer courses;
therefore, the COURSE entity would be optional to the
DEPARTMENT entity.

DATCOM Lab (DATCOM Lab) September 19, 6 / 19


Tiny
College

The interview
process

4 A CLASS is a section of a COURSE. A 1:M


relationship exists between COURSE and CLASS.
▶ Each class is offered during a given semester.
▶ SEMESTER defines the year and the term that the
class will be offered.
▶ It is possible that the Tiny College calendar is set with

semester beginning and ending dates prior to the


creation of the semester class schedule so CLASS is
optional to SEMESTER.

DATCOM Lab (DATCOM Lab) September 19, 7 / 19


Tiny
College

The interview
process

DATCOM Lab (DATCOM Lab) September 19, 8 / 19


Tiny
College

The interview
process
Each department should have one or more professors assigned to it.
5
One and only one of those professors chairs the department, and no
professor is required to accept the chair position.
▶ Therefore, DEPARTMENT is optional to PROFESSOR in the ”chairs”
relationship.
DEP_CODE: k yêu cầu phải là unique vì nhiều giáo sư có thể chung 1 dep
Prof_num: phải yêu cầu là quy nhất vì 1 giáo siuw chỉ làm trưởng 1 bộ môn
và là duy nhất

DATCOM Lab (DATCOM Lab) September 19, 9 / 19


Tiny
College

The interview
process
6 Each professor may teach up to four classes; each class
is a section of a course. A professor may also be on a
research contract and teach no classes at all.
Trong ERD thì k xác định được là 4 lớp mà chỉ xác định là
quan hệ 1:N.
1 lớp có 1 giáo sư và có giáo sư k dạy lớp nào cả

DATCOM Lab (DATCOM Lab) September 19, 10 /


Tiny
College

The interview
process
7 A student may enroll in several classes but take each
class only once during any given enrollment period.
▶ Each student may enroll in up to six classes, and each
class may have up to 35 students, thus creating an M:N
relationship between STUDENT and CLASS.
▶ Because a CLASS can initially exist at the start of the

enrollment period even though no students have


enrolled in it, STUDENT is optional to CLASS in the M:N
relationship.
▶ This M:N relationship must be divided into two 1:M
relationships
through the use of the ENROLL entity.
▶ If a class exists but has no students enrolled in it, that
class does not occur in the ENROLL table. Therefore, the
optional symbol is shown next to ENROLL.
▶ The ENROLL entity is weak: it is existence-dependent, and

its
DATCOM (composite)
Lab (DATCOM Lab) PK is composed of the PKs of the STUDENT
September 19, and
11 /
Tiny
College

The interview
process

DATCOM Lab (DATCOM Lab) September 19, 12 /


Tiny
College

The interview
process
8 Each department has several (or many) students whose
major is offered by that department. However, each
student has only a single major and is therefore
associated with a single department.
▶ However, in the Tiny College environment, it is possible for
a student not to declare a major field of study. Such a
student would not be associated with a department,
therefore, DEPARTMENT is optional to STUDENT.

DATCOM Lab (DATCOM Lab) September 19, 13 /


Tiny
College

The interview
process
9 Each student has an advisor in his or her department;
each advisor counsels several students.
▶ An advisor is also a professor, but not all professors advise
students.
Therefore, STUDENT is optional to PROFESSOR in
the ”PROFESSOR advises STUDENT” relationship.

DATCOM Lab (DATCOM Lab) September 19, 14 /


Tiny
College

The interview
process

1
0
The CLASS entity contains a ROOM CODE attribute which
is an FK to another entity. Clearly, because a class is
taught in a room, it is reasonable to assume that the
ROOM CODE in CLASS is the FK to an entity named
ROOM.
▶ Each room is located in a building. BUILDING can
contain many ROOMs, but each ROOM is found in a
single BUILDING.

DATCOM Lab (DATCOM Lab) September 19, 15 /


Tiny
College

The interview
process

We can identify the following


entities:

DATCOM Lab (DATCOM Lab) September 19, 16 /


Tiny
College

The interview
process
The table summarizes the ERM’s components, and names
the entities and their relations.

DATCOM Lab (DATCOM Lab) September 19, 17 /


Tiny
College

The interview
process

DATCOM Lab (DATCOM Lab) September 19, 18 /


Tiny
College

Questio
ns

DATCOM Lab (DATCOM Lab) September 19, 19 /

You might also like