Unitedworld Institute Of Technology
शक्षणतः सद् ध
B.Tech. Computer Science & Engineering
Semester-3rd
Introduction to
Database Management Systems (DBMS)
Course Code: 71203002003
Unit 2 Prepared By:
ER MODELLING & NORMALISATION FORMS Mr. Manender Dutt, Asstt. Prof.(UIT)
Vision of Department
To be known globally as a School of Excellence that provides transformative educational experience,
creating positive societal impact through establishment of global centers of higher learning in
emerging technology areas of computational intelligence in pursuit of academic excellence.
2
Mission of Department
1. Foster critical thinking and instill values, skills, and attitudes in students to become lifelong
learners and effective problem solvers.
2. Ensure seamless integration of academics, research, and innovation to nurture professional
excellence and entrepreneurship.
3. Create an environment for holistic development by enhancing student-centric welfare
activities, aiming to build socially responsible citizens.
3
Course Outcome
CO1 : Understand Database System Architecture concepts and the underlying
concepts of its technologies, installation and instance setup containing a sample
database.
CO2 : Create ER Diagrams as per problem statement, implement normal forms for
designing a database and utilize DML & DDL commands.
CO3 : Solve any given practical database problem by implementing DML commands of
SQL and PL/SQL including subqueries, joins, views, stored procedures and triggers.
CO4 : Analyze transactions processing, control concurrency techniques and locking
protocols and implement the DCL & TCL commands.
CO5 : Evaluate Database Security, NoSQL Database technologies and create a working
database application for a suitable use case by applying the project-based learning.
4
Syllabus
5
Syllabus
6
UNIT-2
▪Data Modelling using Entity Relationship Model:
◦ ER model concepts, Notations for ER diagram, Mapping cardinalities,
◦ Keys and Constraints, Concepts of Super Key, Candidate key, Primary key and foreign key,
◦ Extended ER model, Generalization & Specialization,
◦ Aggregation, Reduction of ER diagrams to tables. Basics of SQL - DDL, and DML commands.
▪ Functional dependencies, Armstrong's axioms, Normalization and its benefits, Normal forms,
First Normal Form, Second Normal Form, Third Normal Form, BCNF, Fourth Normal Form,
Fifth Normal Form, Dependency preserving decompositions, Lossless join decompositions.
Introduction to ER Modelling & Normalisation
● Content:
i. Overview of Data Modelling using Entity Relationship (ER) Model.
ii. Importance of ER diagrams in database design.
iii. Introduction to Normalisation and its role in reducing data redundancy.
Fun Fact: The ER model was developed by Peter Chen in 1976 & is still a foundational concept in
database design!
Introduction to Data Modelling
● What is Data Modelling?
○ Process of creating a visual representation of data and its relationships.
○ Helps in designing databases at conceptual/logical, and physical levels.
● Why ER Model?
○ Simplifies complex data structures.
○ Provides a clear blueprint for database design.
○ Facilitates communication between stakeholders.
ER Model Concepts
● Entity-Relationship (ER) Model is a high-level conceptual model used to describe the
structure of a database.
● Core Components:
○ Entities: Objects or things in the real world (e.g., Student, Course).
○ Attributes: Properties of entities (e.g., Student ID, Name).
○ Relationships: Associations between entities (e.g., Student enrolls in Course).
● Purpose: Represents real-world scenarios in a structured format for database
implementation.
Entities and Attributes
● Entities:
○ Represented as rectangles in ER diagrams.
○ Types: Strong Entity (has a primary key), Weak Entity (depends on another entity).
● Attributes:
○ Represented as ovals connected to entities.
○ Types:
■ Simple (e.g., Age).
■ Composite (e.g., Name: First Name + Last Name).
■ Single-valued vs. Multi-valued (e.g., Phone Numbers).
■ Derived (e.g., Age from Date of Birth).
● Example: Entity "Student" with attributes: StudentID (primary key), Name, DOB.
Relationships
● It describes how entities interact with each other.
● Types of Relationships:
○ Binary (between two entities).
○ Ternary (involving three entities).
○ Recursive (entity related to itself, e.g., Employee supervises Employee).
● Relationship Attributes: Can have attributes (e.g., Enrollment Date for
Student-Course relationship).
● Example: "Enrolls" relationship between Student and Course entities.
Notations for ER Diagram
● Standard Notations:
○ Entity: Rectangle (e.g., Student, Course).
○ Attribute: Oval (e.g., StudentID, CourseName).
○ Relationship: Diamond (e.g., Enrolls).
○ Primary Key: Underlined attribute (e.g., StudentID).
○ Weak Entity: Double rectangle, connected to strong entity via identifying relationship (double
diamond).
○ Multi-valued Attribute: Double oval (e.g., Phone Numbers).
○ Derived Attribute: Dashed oval (e.g., Age).
● Connectors: Lines linking entities, attributes, and relationships.
Mapping Cardinalities
● Definition: Specifies the number of instances of one entity that can or must be associated with each instance of
another entity.
● Types:
○ One-to-One (1:1): One instance of Entity A relates to one instance of Entity B (e.g., Person ↔ Passport).
○ One-to-Many (1:N): One instance of Entity A relates to multiple instances of Entity B (e.g., Department ↔
Employees).
○ Many-to-One (N:1): Multiple instances of Entity A relate to one instance of Entity B (e.g., Students ↔
Department).
○ Many-to-Many (M:N): Multiple instances of Entity A relate to multiple instances of Entity B (e.g., Students ↔
Courses).
Mapping Cardinalities
Notation in ER Diagram:
● 1:1 → Single line with no special symbol.
● 1:N → Line with a crow’s foot at the "many" side.
● M:N → Line with crow’s feet at both ends.
Example ER Diagram
● Scenario: University Database
○ Entities: Student (StudentID, Name), Course (CourseID, CourseName).
○ Relationship: Enrolls (with attribute EnrollmentDate).
○ Cardinality: Many-to-Many (M:N).
● Diagram:
○ Rectangle: Student, Course.
○ Diamond: Enrolls (connected to Student and Course).
○ Attributes: StudentID (underlined), Name, CourseID (underlined), CourseName,
EnrollmentDate.
○ M:N cardinality shown with crow’s feet on both sides of Enrolls.
Steps to Create an ER Diagram
1. Identify entities and their attributes.
2. Determine relationships between entities.
3. Define cardinalities (1:1, 1:N, M:N).
4. Assign primary keys and other attributes (simple, composite, multi-valued,
derived).
5. Draw the ER diagram using standard notations.
6. Validate the model with stakeholders.
Importance of ER Model
● Simplifies database design process.
● Ensures data integrity and consistency.
● Supports scalability and future modifications.
● Bridges gap between technical and non-technical stakeholders.
Summary
● ER Model: Conceptual framework for database design.
● Components: Entities, Attributes, Relationships.
● Notations: Rectangles, Ovals, Diamonds, Lines.
● Cardinalities:- 1:1, 1:N, N:1, M:N
● Application: Used to create clear, structured, and efficient database designs.
Quiz / Discussion Questions
➔ What are the core components of the Entity-Relationship (ER) Model, and how do they
contribute to designing a database?
➔ Explain the difference between a strong entity and a weak entity, and provide an example
of each with at least two attributes.
➔ Describe the standard notations used in an ER diagram for representing entities, attributes,
and relationships, including how primary keys and multi-valued attributes are denoted.
➔ Define the four types of mapping cardinalities (1:1, 1:N, N:1, M:N) and provide a real-world
example for each type.