Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

UM DIGOS COLLEGE

DEPARTMENT OF TECHNICAL PROGRAMS


Information Technology Program

Lesson 1: Part 2- Review on the relational model and relational operators


What is an ER Model?

ER model stands for an Entity-Relationship model. It is a high-level data model. This model is used to
define the data elements and relationship of a particular system. It gives an overview of a conceptual
database design for a very simple and easy viewing of data. In ER modeling, the database structure is
portrayed as a diagram called an entity-relationship diagram.

There are three components of ER diagram which mainly consist of an entity, attribute, and relation. These
will be discussed in detail below.

Figure 1.0 Entity Relationship Model


Entity: An entity may represent a group of objects, class, person, or place with similar properties. In the
ER diagram, an entity can be represented as rectangles. Consider an organization as an example - teacher,
subject, student, department, etc. can be taken as an entity. See the diagram below.

Figure 1.1 Entities Relationship

Entity types can be classified as strong or weak.


➢ Strong Entity: An entity type can be considered as strong if its existence does not depend on
another entity type. It is also called a regular entity.

➢ Weak Entity: On the contrary, there are also weak entities. An entity that is dependent on another
entity is called a weak entity. This entity type does not contain any key attribute of its own. Below
is the diagrammatic representation of a strong and weak entity.

1
UM DIGOS COLLEGE
DEPARTMENT OF TECHNICAL PROGRAMS
Information Technology Program

Figure 1.2 Strong Entity and Weak Entity

Attributes
It is used to represent the property of an entity or a relationship type. For example, staffNo, name, position,
and salary can be attributes of Staff (See the given diagram below). The attributes contain values that
characterize each entity's existence and represent the main part of the data stored in the database.

Figure 1.3 Entity Attributes

➢ Key Attribute: The key attribute is used to represent the main characteristics of an entity. It
denotes a primary key. In the diagram above, you will see the key attribute (staffNo) represented
by a circle with the text underlined.
➢ Composite Attributes: Refers to an attribute that composed of many other attributes. The
composite attribute is drawn by a circle, and those circles are connected with a circle.
➢ Multivalued Attribute: A type of attribute that can have more than one value is associated as a
multivalued attribute. For example, a student can have more than one mobile number from different
network subscribers.
➢ Derived Attribute: This type of attribute can be originated from other attributes. In the diagram
representation, it is represented by a dashed circle. For example, A person's age changes over time
and can be derived from another attribute like Date of birth.

2
UM DIGOS COLLEGE
DEPARTMENT OF TECHNICAL PROGRAMS
Information Technology Program

Figure 1.4 Attributes on Relationship

As mentioned in the definition of an ER model, attributes can also be assigned in entity relationships. A
relationship is used to describe the relation between entities. In the given examples below, we used a
diamond symbol between two entities to represent the relationship.

TYPES OF ENTITY RELATIONSHIPS:


➢ One-to-One (1:1) Relationship

Figure 1.5 One-to-One (1:1) Relationship

When an entity has only one occurrence associated with the relationship, then it is associated as one
to one relationship. Like in the diagram example, A patient receives a medical prescription, or on
the contrary, a medical prescription is given to a patient.

➢ One-to-Many (1:*) Relationship

Figure 1.6 One-to-Many (1:*) Relationship

If there is only one occurrence of an entity on the left, and on the right entity composed of more
than one occurrence associated with the relationship then this is known as a one-to-many
relationship.
For example, A teacher can teach more than one course, or on the contrary, more than one course
can be handled by a single teacher.

➢ Many-to-Many (*:*) Relationship

3
UM DIGOS COLLEGE
DEPARTMENT OF TECHNICAL PROGRAMS
Information Technology Program

Figure 1.7 Many-to-Many (*:*) Relationship

If there is only one occurrence of an entity on the left, and on the right entity composed of more
than one occurrence associated with the relationship then this is known as a one-to-many
relationship.
When there is more than one occurrence of both entities associated with the relationship, then it is
known as a many-to-many relationship.
For example, A scientist can develop more than one COVID vaccine or on the contrary, a COVID
vaccine can be developed by a scientist

CARDINALITY AND PARTICIPATION CONSTRAINTS


➢ Multiplicity consists of two separate constraints known as cardinality and participation.
➢ Cardinality: Describes the maximum number of possible relationship occurrences for an entity
engaging in a given relationship type.
➢ Participation: It identifies whether all or only some entity occurrences participate in a relationship.

Crow’s Foot Symbols

Figure 1.8 Crow’s Foot Symbols


Since relationship participation is an essential part of database design, it is of great help when you analyze
a particular scenario in which the level of relationship is known. Indicated below are some diagrammatic
examples of entity-relationship participation.

Figure 1.9 Teacher’s and Class Relationship

4
UM DIGOS COLLEGE
DEPARTMENT OF TECHNICAL PROGRAMS
Information Technology Program

Looking at the example “Teacher teaches Class” relationship, the reality is, it is also possible for a
Teacher not to teach a Class. Therefore, Class entity type is optional to Teacher entity. On the other hand,
a Class must be taught by a Teacher. Therefore, Teacher entity type is mandatory to Class entity. Note that
the ERD model in the given diagram shows the cardinality of Student to be (0,5). This indicates that a
Teacher may teach but no Class or the Teacher can teach as many as five Classes. Also, in Teacher entity
type, assuming each class is taught by one and only one Teacher which is represented by (1,1) cardinality.

Figure 2.0 Teacher’s and Classes Relationship


Suppose that each Course generates one or more Classes.

Self Help: You can also refer to the sources below to help you further
understand the lesson:

- Agarwal, Udit(2016). Data mining and data warehousing 2nd Edition. S.K. Kataria & Sons
- Witten, Ian H. (2017). Data mining : Practical Machine Learning Tools and Techniques 4th Ed.
Elsevier
- Nikolay V. Kovalev (2012)., Database Management System, Mandaluyong City: National Book
Store
- Cooper, J. (2013). Database design and sql for db2. Retrieved from
https://ebookcentral.proquest.com
- Molaro, C., Parekh, S., & Purcell, T. (2013). Db2 11 : the database for big data & analytics.
Retrieved from https://ebookcentral.proquest.com
- Taylor, A. G. (2013). Sql for dummies. Retrieved from https://ebookcentral.proquest.com
- Masood-Al-Farooq, B. A. (2014). Sql server 2014 development essentials. Retrieved from
https://ebookcentral.proquest.com

Let’s Check
Activity 1. Encircle the letter of your answer.
1. The logical structure of the database.
a) Database c) Relationship
b) Schema d) ERD
2. What is relational database?
a) A place to store relational information
b) A database that is related to other databases

5
UM DIGOS COLLEGE
DEPARTMENT OF TECHNICAL PROGRAMS
Information Technology Program

c) A database to store human relations


d) None of above
3. Any real-world or system object that wants to model and store information.
a) Entity c) Database
b) Attribute d) Data type
4. It contains information about a particular enterprise and provides an environment that
is both convenient and efficient to use.
a) DBMS c) System
b) Database d) RDBMS
5. In database, it can be a single thing, person, place, or object.
a) Entity c) View
b) Attribute d) Relationship
6. Which of the following gives a logical structure of the database graphically?
a) Entity-relationship diagram
b) Entity diagram
c) Database diagram
d) Architectural representation
7. The entity relationship set is represented in E-R diagram as
a) Double diamonds c) Dashed lines
b) Undivided rectangles d) Diamond
8. Weak entity set is represented as
a) Underline c) Double diamond
b) Double line d) Double rectangle
9. The Rectangles divided into two parts represents
a) Entity set
b) Relationship set
c) Attributes of a relationship set
d) Primary key
10. Which of the following can be a multivalued attribute?
a) Phone_number c) Date_of_birth
b) Name d) All of the mentioned

39
UM DIGOS COLLEGE
DEPARTMENT OF TECHNICAL PROGRAMS
Information Technology Program

Let’s Analyze
Test your knowledge in the concept of ERD and Database Normalization, by answering the following
questions.

Diagram Analysis: Analyze the given diagram and answer the analysis questions below.

1. In the diagram above, what are the attributes of a student?


________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________

2. Do you think “address” could also have other attributes? If no, Why? If yes, provide an
example.

________________________________________________________________________
________________________________________________________________________
________________________________________________________________________

3. How the given attributes interrelated or connected to each other?

________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________

P a g e 2|9
UM DIGOS COLLEGE
DEPARTMENT OF TECHNICAL PROGRAMS
Information Technology Program

In a Nutshell
Based on the definition of the essential term previously and the learning exercises that you have done,
please feel free to write your arguments or lessons learned below.

Question & Answer (Q&A)


You are free to list down all the emerging questions or issues in the provided spaces below.
These questions or concerns may also be raised in the LMS or other modes. You may answer these
questions on your own after clarification. The Q&A portion helps in the review of concepts and essential
knowledge.

P a g e 3|9
UM DIGOS COLLEGE
DEPARTMENT OF TECHNICAL PROGRAMS
Information Technology Program

Questions/Issues Answers




Keywords Index
a. Entity
b. Attributes
c. Instance
d. Entity Set
e. ERD
f. Relationship Key

P a g e 4|9

You might also like