DBMS
DBMS
One-to-Many (1:N)
One entity relates to many others. Example: One teacher
teaches many students.
Many-to-Many (M:N)
Many entities relate to many others. Example: Many
students enroll in many courses.
Components of an ER Diagram
Diagram
Entity Sets Attributes
Collections of similar entities, Properties describing entities,
represented by rectangles. represented by ovals. Example:
Example: 'Student' entity set 'Name', 'StudentID', and
includes all students. 'Major' for a 'Student' entity.
Relationships
Associations between entities, represented by diamonds. Example: A
'Student' may 'Enroll' in a 'Course'.
Key ER Diagram Notations
Rectangle Oval Diamond
Represents an entity set. It indicates a Represents an attribute. It describes a Represents a relationship. It shows how
collection of similar entities, such as all characteristic of an entity, such as a entities are related, such as a student
students in a university database or all student's name, ID, or major, or a enrolling in a course or an employee
products in an inventory system. Each product's price, color or manufacturer. managing a department. The diamond
rectangle in an ER diagram corresponds Attributes provide details about the shape signifies the interaction or
to a table in the relational database. The entities within the database. Each attribute connection between different entities in
entity set includes all entities of a specific has a data type, such as text, number, or the database. Relationships can be one-
type that share common properties or date, which specifies the kind of data it to-one, one-to-many, or many-to-many,
characteristics. For example, in a library can hold. For instance, a 'Date of Birth' indicating the cardinality of the
database, the 'Book' entity set would attribute for a 'Student' entity would have relationship. For instance, a 'One-to-
include every book stored in the library's a date data type, while a 'Student ID' Many' relationship between 'Department'
inventory. attribute might be defined as a numeric and 'Employee' indicates that one
type. department can have multiple employees,
but each employee belongs to only one
department.
Advantages and Limitations of ER Models
Advantages Limitations
• Simple and Easy to Understand: ER models offer a • Doesn't Show Data Manipulation: ER models focus on
straightforward way to visualize database structure, data structure, not the operations performed on the data,
making them accessible to both technical and non- which are better represented using other techniques.
technical stakeholders. • Can Become Complex for Large Databases: In very large
• Visually Represents Data Relationships: Clearly illustrates databases with numerous entities and relationships, ER
how different entities are related, aiding in database diagrams can become unwieldy and difficult to manage.
design and communication.
• Effective Communication Tool: Facilitates discussions • Limited Expressiveness for Certain Constraints: ER models
between designers, developers, and end-users, ensuring may not be able to express all complex rules and
everyone has a clear understanding of the database. constraints that need to be enforced in a database,
requiring supplemental documentation or constraints.
Real-World Example: A
University Database
1 Entities
Student, Course, Professor
2 Relationships
Student enrolls in Course, Professor teaches Course
3 Attributes
Student ID, Course Name, Professor Name
Conclusion: ER Models Simplify
Database Design
Entity-Relationship (ER) Models are essential for designing and managing
databases effectively, acting as a blueprint for structuring data. They offer
a clear, visual way to represent complex data relationships, making it
easier to understand how different pieces of information connect within a
system. This visual representation is invaluable in the initial stages of
database development, ensuring a solid foundation for the project.