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

Module 4

The document defines key concepts in data modeling including entities, attributes, relationships, and cardinalities. It provides examples of each component in an entity relationship diagram with students and subjects. It also explains the different types of relationships and cardinality constraints.
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 views21 pages

Module 4

The document defines key concepts in data modeling including entities, attributes, relationships, and cardinalities. It provides examples of each component in an entity relationship diagram with students and subjects. It also explains the different types of relationships and cardinality constraints.
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/ 21

Modeling Data in the

Organization (cont.)
Database Management System I
Objectives of this Chapter
• Define the key terminologies used in data modeling.
• Enumerate the different components of an ER Diagram.
• Differentiate and model the different types of entities, relationships,
attributes, and cardinalities.
• Distinguish the three degrees of relationship.
• Enumerate the cardinalities of relationship.
• Draw an example of a simple ER Diagram used in a realistic business
situation.
Components of an ER Diagram
2. Attribute
• Refers to the property or characteristic that describes an entity or
relationship type.
ENTITY NAME

Identifier
Partial Identifier
ATTRIBUTE SYMBOLS Optional
[Derived]
{Multivalued}
Composite ( , , , )
Classifications of Attributes
• Required vs. Optional Attributes

• Simple vs. Composite Attribute

• Single-Valued vs. Multivalued Attribute

• Stored vs. Derived Attributes

• Identifier Attributes
Examples of the Attributes
An Entity that has a COMPOSITE An Entity that has a MULTIVALUED and
ATTRIBUTE DERIVED ATTRIBUTE

STUDENT EMPLOYEE

Student_No. Employee_ID
Student_Name Employee_Name
Student_Address (Street, Employee_Address
Brgy, City, Province, Date_Employed
Postal_Code) Position
Birthday Multivalued Attribute {Skill}
Contact_Number [Years_Employed] Derived Attribute
Characteristics of an Identifier
• An identifier should always have a value.

• The value of the identifier must be consistent at all times.

• There should be no intelligent identifiers.


Simple and Composite Identifier Attribute
SIMPLE IDENTIFIER ATTRIBUTE COMPOSITE IDENTIFIER ATTRIBUTE

STUDENT FLIGHT

Student_No. Flight_ID
Student_Name (Flight_Number, Date)
Student_Address (Street, Number_of_Passengers
Brgy, City, Province, Location
Postal_Code)
Birthday
Contact_Number
Components of an ER Diagram
3. Relationship
• Relationship type –category of relationship

STUDENT

Student_No. enrolls SUBJECT


Student_Name
Student_Address (Street, Subject_Code
Brgy, City, Province, Subject_Title
enrolled_by
Postal_Code) Subject_Description
Birthday
Contact_Number

Many-to-Many Relationship
Relationship
3. Relationship
• Relationship instance – refers to the link between entities
STUDENT SUBJECT

Angela Java

Mark C++

Nicole Web

James SQL

Claire Visual Basic


Cardinality of Relationships
• One-to-One
• Each entity involved in the relationship will have exactly one related entity.
• Each record of a table is related to exactly one record of the other table.

• One-to-Many
• An entity on one side of the relationship can have many related entities, but an entity on the other
side will have a maximum of one related entity.
• Each record of a particular table can be related to one or more than one record of the other table.

• Many-to-Many
• Entities on both sides of the relationship can have many related entities on the other side.
• Each record of the table can be related to one or more than one record of the other table and vice
versa.
Degrees of Relationships
• Refers to the number of entity types involved in the relationship
UNARY BINARY
RELATIONSHIP RELATIONSHIP
- Involves an entity - Composed of two
which is related to different entity types
the same entity type. related to each other.

TERNARY
RELATIONSHIP
- Composed of three
different entity types
related to each other.
Examples of the Degrees of Relationships
• Unary Relationship

is_married_to manages
composes

PERSON EMPLOYEE ITEM

ONE-TO-ONE RELATIONSHIP ONE-TO-MANY RELATIONSHIP MANY-TO-MANY RELATIONSHIP


Examples of the Degrees of Relationships
• Binary Relationship

is_assigned_to treats
EMPLOYEE DEPARTMENT DOCTOR PATIENT

ONE-TO-ONE RELATIONSHIP ONE-TO-MANY RELATIONSHIP

enrolls
STUDENT SUBJECT

MANY-TO-MANY RELATIONSHIP
Examples of the Degrees of Relationships
• Ternary Relationship

enrolls
STUDENT SUBJECT

INSTRUCTOR

MANY-TO-MANY RELATIONSHIP
Cardinality Constraints
• Indicates the number of instances of an entity that can or must be
associated with the instance of another entity type.

• Minimum Cardinality
• Optional - Zero
• Mandatory – one or more

• Maximum Cardinality
• Maximum number
Relationship Cardinality
MANDATORY
ONE

MANDATORY
MANY

OPTIONAL
ONE

OPTIONAL
MANY
Examples of Cardinality Constraints
• Both sides of the relationship is mandatory

STUDENT SUBJECT

enrolls Angela Java

STUDENT SUBJECT
Mark C++
enrolled_by

Nicole Web

James SQL

Claire Visual Basic


Examples of Cardinality Constraints
• One side of the relationship is mandatory and the other is optional.

PATIENT MEDICINE

takes Carlo Antihistamine

PATIENT MEDICINE Vitamin C


Anna
taken_by Paracetamol

Mona Aspirin

Vitamin B
Luis
Examples of Cardinality Constraints
• Both sides of the relationship is optional
PERSON

Marie

Jerome
is_married_to
PERSON Paul

Joana

Therese

Gabriel
Example of Multiple Relationship

supervises
prepares prepared_by

FACULTY EXAM

checks checked_by

supervised_by
ER Diagram
offers enrolled_by

COLLEGE COURSE STUDENT


offered_by enrolls
consists taught_by

contained_in teaches

handled_by

SUBJECT PROFESSOR
handles

Pre-requisites

You might also like