Professional Documents
Culture Documents
Chapter 4 Entity Relationship (ER) Modeling
Chapter 4 Entity Relationship (ER) Modeling
Chapter 4 Entity Relationship (ER) Modeling
INTRODUCTION TO DATABASE
MANAGEMENT SYSTEM
By :
Miss Noorfadzilah Arifin
➢ Entities (object)
➢ Attributes
➢ Relationships
Entities
Corresponds to table
Characteristics of entities
Connectivity
➢ Used to describe the relationship classification
Cardinality
➢ Expresses minimum and maximum number of entity
occurrences associated with one occurrence of related entity
➢ In ERD, cardinality is indicated by placing the appropriate
number beside the entities, using the format (x, y). x = min
number of associated entities, y = min number of associated
entities
➢ Cardinality (1, N) indicate there would be no upper limit
Existence dependence
➢ Exist in database only when it is associated with another
related entity occurrence
Existence independence
➢ Entity can exist apart from one or more related entities
➢ Existence-dependent
Optional participation
One entity occurrence does not require
corresponding entity occurrence in particular
relationship
Mandatory participation
One entity occurrence requires corresponding entity
occurrence in particular relationship
Relationship Participation (continued)
Relationship Participation (continued)
Relationship Participation (continued)
Relationship Participation (continued)
Relationship Degree
Binary relationship
➢ Two entities are associated
Ternary relationship
➢ Three entities are associated
Relationship Degree (continued)
Relationship Degree (continued)
Recursive Relationships
Iterative process
Tiny College
- Tiny College is divided into several schools. Each school is
administered by a dean who is professor.
Tiny College
- Each department may offer courses
Developing an ER Diagram (continued)
Tiny College
- A department may offer several classes of the same database course.
- Each of those classes is taught by a professor at a given time in a given
place.
- Each professor may teach up to four classes, each class is a section of a
course.
- A professor may also be a research contract and teach no classes at all
Developing an ER Diagram (continued)
Tiny College
- Student may enroll in several classes, but (s)he takes 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
- A class can initially exist even though no students have enrolled in it.
Developing an ER Diagram (continued)
Tiny College
- Each student has only a single major and is associated with a single
department
Developing an ER Diagram (continued)
Tiny College
- Each student has an advisor in his or her department
- Each advisor counsels several students
- An advisor is also a professor, but not all professor advise students
Developing an ER Diagram (continued)
Tiny College
- The relationship between class is taught in a room and the room in the
building
Developing an ER Diagram (continued)
EXERCISE 1
64
A trainee can take more than one class, and each class contains
many trainees.
Entity supertype
Generic entity type that is related to one or more
entity subtypes
Entity subtypes
Contains unique characteristics of each entity subtype
Entity Supertypes and Subtypes
Specialization Hierarchy
Disjoint subtypes
Overlapping subtypes
Specialization
Top-down process of identifying lower-level, more specific
entity subtypes from higher-level entity supertype
Generalization
Elite has two types of customers: retail and wholesale. All customers have a
customer ID, a name, an address, a phone number, a default shipping address,
a date of last purchase, and a date of last payment.
Retail customers have the credit card type, credit card number, expiration date,
and e-mail address.
Given that information, create the ERD containing all primary keys, foreign
keys, and main attributes
Exercise 2
❑ A company has five departments: administration, marketing, sales, shipping,
and purchasing. Each department employs many employees.
❑ Each employee has an ID, a name, a home address, a home phone number,
and a salary and tax ID.
Given that information, create the ERD containing all primary keys, foreign
keys, and main attributes.
Exercise 3
The FlyRight Aircraft Maintenance (FRAM) division of the FlyRight Company
(FRC) performs all maintenance for FRC’s aircraft. Produce a data model
segment that reflects the following business rules:
All mechanics are FRC employees. Not all employees are mechanics.
All mechanics take periodic training courses to stay current in their areas of
expertise. FRC tracks all courses taken by each mechanic—date, course type,
certification (Y/N), and performance.
FRC keeps a history of the employment of all mechanics. The history includes
the date hired, date promoted, date terminated, and so on.