4.1 Introduction to the Entity–Relationship Model
Before databases can be queried using SQL, they must first be designed properly. Database design ensures that information is stored logically, efficiently, and without redundancy. One of the most important tools used in database design is the Entity–Relationship Model, commonly known as the ER Model.

The ER Model provides a visual representation of how data is structured within a system. It identifies the key objects involved, the properties associated with those objects, and the relationships between them. By organizing information in this structured way, database designers can create systems that are easier to maintain, scale, and analyze.
An ER diagram serves as a blueprint for a database. Just as architects draw building plans before construction begins, data professionals create ER diagrams before implementing databases.
For example, when designing a university database system, entities such as students, courses, lecturers, and departments must be clearly defined, along with the relationships that connect them. Without this planning stage, the resulting database structure would likely become inefficient and difficult to manage.
4.2 Understanding Entities
An entity represents a real-world object or concept about which data is stored. Entities can be physical objects, such as students or products, or conceptual objects, such as transactions or enrollments.

Each entity contains information known as attributes, which describe its characteristics.
For instance, a student entity may include attributes such as student identification number, name, department, and date of admission. Similarly, a product entity might include product ID, name, category, and price.
Entities are typically represented as rectangles in ER diagrams, making them easy to identify visually.
4.3 Strong and Weak Entities
Entities are classified into two main categories: strong entities and weak entities.
A strong entity is an entity that can exist independently within the database. It has a primary key that uniquely identifies each instance. For example, a student entity can exist independently because each student has a unique student ID.

In contrast, a weak entity depends on another entity for its existence. It does not have a primary key of its own and relies on a related entity to provide identification. Weak entities are often associated with situations where information cannot stand alone.
Consider an exam marks record. Marks cannot exist without being associated with both a student and an exam. Therefore, marks can be considered a weak entity because they depend on other entities for context and identification.
Weak entities are typically represented using double rectangles in ER diagrams to distinguish them from strong entities.
Understanding the distinction between strong and weak entities helps database designers create logical and consistent database structures.
4.4 Understanding Attributes
Attributes describe the properties or characteristics of entities. They provide the details that define each instance of an entity.
There are several types of attributes commonly used in database design.
A simple attribute cannot be divided further. For example, age or salary represents a simple attribute because it contains a single value.
A single-valued attribute holds only one value for each entity instance. A student identification number is an example of a single-valued attribute because each student has only one ID.
A composite attribute can be divided into smaller components. A full name attribute, for example, may consist of first name, middle name, and last name.
A multi-valued attribute can contain multiple values for a single entity instance. A student may have more than one phone number, making phone number a multi-valued attribute.
A derived attribute is calculated from other attributes rather than stored directly in the database. Age, for instance, can be derived from a person’s date of birth.
Attributes are represented as ellipses in ER diagrams, with special visual distinctions used for composite, multi-valued, and derived attributes.
Understanding attribute types helps ensure that data is stored efficiently and redundancies are minimized.
4.5 Relationships Between Entities
Entities rarely exist in isolation. Instead, they interact with one another through relationships. A relationship describes how two or more entities are connected within a system.
For example, a student enrolls in a course, a customer places an order, and a player participates in a match. Each of these scenarios represents relationships between entities.

Relationships are represented as diamonds in ER diagrams and are connected to entities using lines.
Relationships can exist in different forms depending on how entities interact.
A one-to-one relationship occurs when one instance of an entity is associated with only one instance of another entity. For example, each employee may have one identification badge.
A one-to-many relationship occurs when one instance of an entity is associated with multiple instances of another entity. A teacher may teach multiple courses, but each course may be taught by only one teacher.
A many-to-one relationship is the reverse of a one-to-many relationship. Multiple students may belong to one department.
A many-to-many relationship occurs when multiple instances of one entity are associated with multiple instances of another entity. Students enrolling in multiple courses is a classic example of a many-to-many relationship.
Understanding relationship types helps database designers determine how tables should be structured and connected.
4.6 Symbols Used in ER Diagrams
ER diagrams use standardized symbols to represent entities, attributes, and relationships clearly.
Rectangles represent entities and serve as the primary building blocks of the diagram.

Ellipses represent attributes and describe entity properties.
Diamonds represent relationships and illustrate how entities interact.
Lines connect entities to relationships and attributes, showing their associations.
Double rectangles represent weak entities, while double ellipses represent multi-valued attributes. Dashed ellipses indicate derived attributes.
These symbols provide a universal language that allows database designers to communicate structure effectively.
4.7 Example ER Diagram: Student, Exam, and Marks
To better understand how ER diagrams work, consider a simple academic system containing students, exams, and marks.

In this system, the student entity contains attributes such as student ID and name. The exam entity includes the exam ID and the subject name. The marks entity records the score obtained by each student in each exam.
The relationship between students and exams is many-to-many because each student can take multiple exams, and each exam can be taken by multiple students. The marks entity acts as a bridge connecting these two entities and stores the results of their interaction.
This example demonstrates how weak entities and relationships work together within a structured database system.
4.8 Example ER Diagram: Match, Player, and Score
Consider another example from a sports management system involving matches, players, and scores.

In this system, the player entity contains information about individual athletes, while the match entity stores details about each game played. The score entity records the performance of players during matches.
Since multiple players participate in multiple matches, the relationship between players and matches is many-to-many. The score entity captures the outcome of each player’s participation in each match.
This example highlights how ER diagrams help represent complex real-world relationships clearly and logically.
4.9 Importance of the ER Model in Database Design
The ER Model plays a critical role in transforming real-world requirements into structured database systems. By clearly identifying entities, attributes, and relationships, designers can eliminate redundancy and ensure data consistency.

A well-designed ER diagram simplifies database implementation and improves communication between stakeholders, developers, analysts, and database administrators. It also ensures that the resulting database supports efficient querying and analysis.
Because of its clarity and flexibility, the ER Model remains one of the most widely used tools in database design.
4.10 Practical Exercise: Designing an ER Diagram
To apply the concepts learned in this chapter, consider designing a simple ER diagram for a library system.

Begin by identifying the main entities involved, such as books, members, and loans. Next, determine the attributes associated with each entity. Then identify relationships, such as members borrowing books.
Finally, represent the structure using standard ER diagram symbols.
This exercise reinforces the importance of planning database structures before implementation.
4.11 Key Takeaways
The Entity–Relationship Model provides a structured approach to designing databases by identifying entities, attributes, and relationships. Entities can be strong or weak depending on whether they exist independently. Attributes describe entity characteristics and may be simple, composite, multi-valued, or derived.
Relationships define how entities interact and may be one-to-one, one-to-many, many-to-one, or many-to-many. ER diagrams use standardized symbols such as rectangles, ellipses, and diamonds to represent these components visually.
By mastering the ER Model, learners gain the ability to design efficient databases that support accurate storage, retrieval, and analysis of information.