SlideShare a Scribd company logo
Database design
Topics to be covered
• Database design & E-R Model
• Entity–Relationship model (E-R model)
• E-R Diagrams-Constraints
• Extended E-R features
Database design
• The database designer needs to interact
extensively with domain experts and specify the
user requirements
• The designer chooses a data model and, by
applying the concepts of the chosen data model,
translates these requirements into a conceptual
schema of the database
• At the stage of conceptual design, the designer
can review the schema to ensure it meets
functional requirements
Database design (Contd..)
• Logical-design phase
– The conceptual schema defined using the entity-
relationship model is converted into a relation
schema in this phase
• Physical-design phase
– The physical features of the database are specified
in this phase
ER Model
• The Entity Relational Model is a model for
identifying entities to be represented in the
database and representation of how those
entities are related
• The ER data model specifies enterprise
schema that represents the overall logical
structure of a database graphically
Why Use ER Diagrams In DBMS?
• ER diagrams are used to represent the E-R model in a
database, which makes them easy to convert into
relations (tables)
• ER diagrams provide the purpose of real-world
modeling of objects which makes them intently useful
• ER diagrams require no technical knowledge and no
hardware support
• These diagrams are very easy to understand and easy
to create even for a naive user
• It gives a standard solution for visualizing the data
logically
Symbols Used in ER Model
• Rectangles: Rectangles represent Entities in the ER Model
• Ellipses: Ellipses represent Attributes in the ER Model
• Diamond: Diamonds represent Relationships among
Entities
• Lines: Lines represent attributes to entities and entity sets
with other relationship types
• Double Ellipse: Double Ellipses represent Multi-Valued
Attributes
• Double Rectangle: Double Rectangle represents a Weak
Entity
Symbols used in ER model
Components of ER model
Example
Entity
Entity can be any real world object
Entity Set
An entity set is a set of entities of the same
type that share the same properties,
or attributes.
Strong Entity
• A strong entity is not dependent on any other
entity in the schema
• A strong entity will always have a primary key
• Strong entities are represented by a single
rectangle
• The relationship of two strong entities is
represented by a single diamond
• Various strong entities, when combined together,
create a strong entity set
Weak entity
• A weak entity is dependent on a strong entity to
ensure its existence
• Unlike a strong entity, a weak entity does not
have any primary key
• It instead has a partial discriminator key
• A weak entity is represented by a double
rectangle
• The relation between one strong and one weak
entity is represented by a double diamond
Example-1
Example-2
Attributes
Attributes are the properties that define the entity type.
For example, Roll_No, Name, DOB, Age, Address, and Mobile_No are the
attributes that define entity type Student.
Key Attribute
The attribute which uniquely identifies each entity in the entity set is called the key
attribute.
For example, Roll_No will be unique for each student
In ER diagram, the key attribute is represented by an oval with underlying lines
Composite Attribute
• An attribute composed of many other
attributes is called a composite attribute
• For example, the Address attribute of the
student Entity type consists of Street, City,
State, and Country
• In ER diagram, the composite attribute is
represented by an oval comprising of ovals
Composite Attribute (Contd..)
Multivalued Attribute
An attribute consisting of more than one value for a given entity
For example, Phone_No (can be more than one for a given student)
In ER diagram, a multivalued attribute is represented by a double oval
Derived Attribute
• An attribute that can be derived from other
attributes of the entity type is known as a
derived attribute
• E.g.; Age (can be derived from DOB)
• In ER diagram, the derived attribute is
represented by a dashed oval
Example
Student Entity Set with its attributes
Entity-Relationship Diagram
ER diagram corresponding to instructors and students
Relationship Type
• A Relationship Type represents the association
between entity types
• For example, ‘Enrolled in’ is a relationship type
that exists between entity type Student and
Course
• In ER diagram, the relationship type is
represented by a diamond and connecting the
entities with lines
Example
Relationship Set
• A set of relationships of the same type is
known as a relationship set
• The following relationship set depicts S1 as
enrolled in C2, S2 as enrolled in C1, and S3 as
registered in C3
Relationship Set
Degree of a Relationship Set
• The number of different entity sets
participating in a relationship set is called
the degree of a relationship set
• Different types of degree of a Relationship set
are
– Unary Relationship
– Binary Relationship
– n-ary Relationship
Unary Relationship
When there is only ONE entity set participating in a relation, the relationship is called
a unary relationship
Binary Relationship
When there are TWO entities set participating in a
relationship, the relationship is called a binary relationship.
For example, a Student is enrolled in a Course.
n-ary Relationship
• When there are n entities set participating in a
relation, the relationship is called an n-ary
relationship.
Cardinality
• The number of times an entity of an entity set
participates in a relationship set is known
as cardinality.
• Cardinality can be of different types
– One-to-One
– One-to-Many
– Many-to-One
– Many-to-Many
One-to-One
• When each entity in each entity set can take
part only once in the relationship, the
cardinality is one-to-one
• Example
One-to-Many
• In one-to-many mapping as well where each
entity can be related to more than one
relationship and the total number of tables
that can be used in this is 2
• Let us assume that one surgeon department
can accommodate many doctors
• So the Cardinality will be 1 to M
• It means one department has many Doctors
One to many (Contd..)
Many-to-One
• When entities in one entity set can take part
only once in the relationship set and entities
in other entity sets can take part more than
once in the relationship set, cardinality is
many to one
Many to one (Contd..)
Many-to-Many
• When entities in all entity sets can take part
more than once in the relationship cardinality
is many to many
• For example, student S1 is enrolled in C1 and
C3 and Course C3 is enrolled by S1, S3, and S4.
So it is many-to-many relationships
Many to many (Contd..)
Participation Constraint
• Participation Constraint is applied to the entity
participating in the relationship set
• Total Participation
• Each entity in the entity set must participate
in the relationship
• If each student must enroll in a course, the
participation of students will be total
• Total participation is shown by a double line in
the ER diagram
Participation Constraint
• Partial Participation
• The entity in the entity set may or may NOT
participate in the relationship
• If some courses are not enrolled by any of the
students, the participation in the course will
be partial
Total and Partial participation
Example
Example
Extended E-R Features
• Specialization
• Generalization
• Higher- and lower-level entity sets
• Attribute inheritance
• Aggregation
Specialization
• An entity set may include subgroupings of entities that are
distinct in some way from other entities in the set.
• The process of designating subgroupings within an entity
set is called specialization
• The specialization of person allows us to distinguish among
person entities according to whether they correspond to
employees or students
• The specialization relationship may also be referred to as a
superclass-subclass relationship
• Example :The university could create two specializations of
student, namely graduate and undergraduate
– Overlapping specialization
– Disjoint specialization
Specialization (Contd..
)
• For an overlapping specialization (as is the
case for student and employee as
specializations of person), two separate
arrows are used.
• For a disjoint specialization (as is the case for
instructor and secretary as specializations of
employee), a single arrow is used
Generalization
• Generalization proceeds from the recognition
that a number of entity sets share some
common features (namely, they are described
by the same attributes and participate in the
same relationship sets)
Specialization and generalization
Attribute Inheritance
• Attribute inheritance: allows lower level
entities to inherit the attributes of higher level
entities and vice versa
• Example: Car entity is an inheritance
of Vehicle entity ,So Car can acquire attributes
of Vehicle
• Example:car can acquire Model attribute
of Vehicle
Aggregation
• An ER diagram is not capable of representing the relationship
between an entity and a relationship which may be required in
some scenarios
• In those cases, a relationship with its corresponding entities is
aggregated into a higher-level entity
• Aggregation is an abstraction through which we can represent
relationships as higher-level entity sets
• For Example, an Employee working on a project may require some
machinery
• So, REQUIRE relationship is needed between the relationship
WORKS_FOR and entity MACHINERY
• Using aggregation, WORKS_FOR relationship with its entities
EMPLOYEE and PROJECT is aggregated into a single entity and
relationship REQUIRE is created between the aggregated entity and
MACHINERY.
Aggregation
Symbols used in ER notation
Alternative ER notations
Thank You

More Related Content

PPTX
Introduction to Artificial Intelligence Agents.pptx
PPTX
Chapter 08
PPTX
1.4 data independence
PPT
Software Processes
PDF
Chap.3 Knowledge Representation Issues Chap.4 Inference in First Order Logic
PPTX
Database management systems
PPTX
Use case diagram
PPT
Chapter 15 software product metrics
Introduction to Artificial Intelligence Agents.pptx
Chapter 08
1.4 data independence
Software Processes
Chap.3 Knowledge Representation Issues Chap.4 Inference in First Order Logic
Database management systems
Use case diagram
Chapter 15 software product metrics

What's hot (20)

PPT
Software Process Model in software engineering
PPTX
Unified modeling language diagrams
PPT
10 component diagram
PPTX
Entity Relationship Model
PPT
Entity relationship diagram
PPT
System requirements specification (srs)
PPTX
Object Oriented Analysis & Design
PPTX
Software cost estimation techniques presentation
PDF
Unit 1-Introduction to Data Structures-BCA.pdf
PPTX
Activity diagram model
PPTX
Chapter 1 2 - some size factors
PPTX
Diagrams
PPTX
PPTX
Data analytics with R
PPTX
Basic Behavioral Modeling
PPT
Aggregation
PPT
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
PPTX
Data types
PPTX
Design issues with constraints of E-R model
Software Process Model in software engineering
Unified modeling language diagrams
10 component diagram
Entity Relationship Model
Entity relationship diagram
System requirements specification (srs)
Object Oriented Analysis & Design
Software cost estimation techniques presentation
Unit 1-Introduction to Data Structures-BCA.pdf
Activity diagram model
Chapter 1 2 - some size factors
Diagrams
Data analytics with R
Basic Behavioral Modeling
Aggregation
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
Data types
Design issues with constraints of E-R model
Ad

Similar to Database Design and Entity relationship Model.pptx (20)

PPT
ermodelN in database management system.ppt
PPT
3144-unit-1entityrmodel-171122051336.ppt
PPTX
DBMS Conceptual Design using ER Model.pptx
PPTX
Entity Relationship Diagram – ER Diagram in DBMS.pptx
PPT
ER-Model-ER Diagram
PPTX
Entity Relationship Diagram – ER Diagram in DBMS.pptx
PPT
Unit 2 ER Model.ppterfgmefwlgmkldfsmglkdfg
PPTX
Unit iv dbms
PPT
ER Diagram introduction .ppt
PPTX
E_R-Diagram (2).pptx
PPTX
Data modeling
PPT
E-R Model Entity relationship model, Entity, Attributes.ppt
PPT
Entity relationship Model, Unit-1.2-1.ppt
PPTX
DBMS Unit-2_Final.pptx
PPT
ENTITY RELATION SHIPS COMPLETE ANALYSIS UPDATED
ODP
ER Model in DBMS
PPTX
E-R Diagram and their models using datbase
PPTX
Entityrelationshipmodel
PPTX
Data model and entity relationship
PPTX
Er model
ermodelN in database management system.ppt
3144-unit-1entityrmodel-171122051336.ppt
DBMS Conceptual Design using ER Model.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptx
ER-Model-ER Diagram
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Unit 2 ER Model.ppterfgmefwlgmkldfsmglkdfg
Unit iv dbms
ER Diagram introduction .ppt
E_R-Diagram (2).pptx
Data modeling
E-R Model Entity relationship model, Entity, Attributes.ppt
Entity relationship Model, Unit-1.2-1.ppt
DBMS Unit-2_Final.pptx
ENTITY RELATION SHIPS COMPLETE ANALYSIS UPDATED
ER Model in DBMS
E-R Diagram and their models using datbase
Entityrelationshipmodel
Data model and entity relationship
Er model
Ad

Recently uploaded (20)

PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Construction Project Organization Group 2.pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
composite construction of structures.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Welding lecture in detail for understanding
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
DOCX
573137875-Attendance-Management-System-original
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPT
Mechanical Engineering MATERIALS Selection
PPTX
web development for engineering and engineering
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
CYBER-CRIMES AND SECURITY A guide to understanding
Construction Project Organization Group 2.pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
composite construction of structures.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Welding lecture in detail for understanding
Internet of Things (IOT) - A guide to understanding
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
573137875-Attendance-Management-System-original
R24 SURVEYING LAB MANUAL for civil enggi
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Mechanical Engineering MATERIALS Selection
web development for engineering and engineering
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks

Database Design and Entity relationship Model.pptx

  • 2. Topics to be covered • Database design & E-R Model • Entity–Relationship model (E-R model) • E-R Diagrams-Constraints • Extended E-R features
  • 3. Database design • The database designer needs to interact extensively with domain experts and specify the user requirements • The designer chooses a data model and, by applying the concepts of the chosen data model, translates these requirements into a conceptual schema of the database • At the stage of conceptual design, the designer can review the schema to ensure it meets functional requirements
  • 4. Database design (Contd..) • Logical-design phase – The conceptual schema defined using the entity- relationship model is converted into a relation schema in this phase • Physical-design phase – The physical features of the database are specified in this phase
  • 5. ER Model • The Entity Relational Model is a model for identifying entities to be represented in the database and representation of how those entities are related • The ER data model specifies enterprise schema that represents the overall logical structure of a database graphically
  • 6. Why Use ER Diagrams In DBMS? • ER diagrams are used to represent the E-R model in a database, which makes them easy to convert into relations (tables) • ER diagrams provide the purpose of real-world modeling of objects which makes them intently useful • ER diagrams require no technical knowledge and no hardware support • These diagrams are very easy to understand and easy to create even for a naive user • It gives a standard solution for visualizing the data logically
  • 7. Symbols Used in ER Model • Rectangles: Rectangles represent Entities in the ER Model • Ellipses: Ellipses represent Attributes in the ER Model • Diamond: Diamonds represent Relationships among Entities • Lines: Lines represent attributes to entities and entity sets with other relationship types • Double Ellipse: Double Ellipses represent Multi-Valued Attributes • Double Rectangle: Double Rectangle represents a Weak Entity
  • 8. Symbols used in ER model
  • 11. Entity Entity can be any real world object
  • 12. Entity Set An entity set is a set of entities of the same type that share the same properties, or attributes.
  • 13. Strong Entity • A strong entity is not dependent on any other entity in the schema • A strong entity will always have a primary key • Strong entities are represented by a single rectangle • The relationship of two strong entities is represented by a single diamond • Various strong entities, when combined together, create a strong entity set
  • 14. Weak entity • A weak entity is dependent on a strong entity to ensure its existence • Unlike a strong entity, a weak entity does not have any primary key • It instead has a partial discriminator key • A weak entity is represented by a double rectangle • The relation between one strong and one weak entity is represented by a double diamond
  • 17. Attributes Attributes are the properties that define the entity type. For example, Roll_No, Name, DOB, Age, Address, and Mobile_No are the attributes that define entity type Student.
  • 18. Key Attribute The attribute which uniquely identifies each entity in the entity set is called the key attribute. For example, Roll_No will be unique for each student In ER diagram, the key attribute is represented by an oval with underlying lines
  • 19. Composite Attribute • An attribute composed of many other attributes is called a composite attribute • For example, the Address attribute of the student Entity type consists of Street, City, State, and Country • In ER diagram, the composite attribute is represented by an oval comprising of ovals
  • 21. Multivalued Attribute An attribute consisting of more than one value for a given entity For example, Phone_No (can be more than one for a given student) In ER diagram, a multivalued attribute is represented by a double oval
  • 22. Derived Attribute • An attribute that can be derived from other attributes of the entity type is known as a derived attribute • E.g.; Age (can be derived from DOB) • In ER diagram, the derived attribute is represented by a dashed oval
  • 23. Example Student Entity Set with its attributes
  • 24. Entity-Relationship Diagram ER diagram corresponding to instructors and students
  • 25. Relationship Type • A Relationship Type represents the association between entity types • For example, ‘Enrolled in’ is a relationship type that exists between entity type Student and Course • In ER diagram, the relationship type is represented by a diamond and connecting the entities with lines
  • 27. Relationship Set • A set of relationships of the same type is known as a relationship set • The following relationship set depicts S1 as enrolled in C2, S2 as enrolled in C1, and S3 as registered in C3
  • 29. Degree of a Relationship Set • The number of different entity sets participating in a relationship set is called the degree of a relationship set • Different types of degree of a Relationship set are – Unary Relationship – Binary Relationship – n-ary Relationship
  • 30. Unary Relationship When there is only ONE entity set participating in a relation, the relationship is called a unary relationship
  • 31. Binary Relationship When there are TWO entities set participating in a relationship, the relationship is called a binary relationship. For example, a Student is enrolled in a Course.
  • 32. n-ary Relationship • When there are n entities set participating in a relation, the relationship is called an n-ary relationship.
  • 33. Cardinality • The number of times an entity of an entity set participates in a relationship set is known as cardinality. • Cardinality can be of different types – One-to-One – One-to-Many – Many-to-One – Many-to-Many
  • 34. One-to-One • When each entity in each entity set can take part only once in the relationship, the cardinality is one-to-one • Example
  • 35. One-to-Many • In one-to-many mapping as well where each entity can be related to more than one relationship and the total number of tables that can be used in this is 2 • Let us assume that one surgeon department can accommodate many doctors • So the Cardinality will be 1 to M • It means one department has many Doctors
  • 36. One to many (Contd..)
  • 37. Many-to-One • When entities in one entity set can take part only once in the relationship set and entities in other entity sets can take part more than once in the relationship set, cardinality is many to one
  • 38. Many to one (Contd..)
  • 39. Many-to-Many • When entities in all entity sets can take part more than once in the relationship cardinality is many to many • For example, student S1 is enrolled in C1 and C3 and Course C3 is enrolled by S1, S3, and S4. So it is many-to-many relationships
  • 40. Many to many (Contd..)
  • 41. Participation Constraint • Participation Constraint is applied to the entity participating in the relationship set • Total Participation • Each entity in the entity set must participate in the relationship • If each student must enroll in a course, the participation of students will be total • Total participation is shown by a double line in the ER diagram
  • 42. Participation Constraint • Partial Participation • The entity in the entity set may or may NOT participate in the relationship • If some courses are not enrolled by any of the students, the participation in the course will be partial
  • 43. Total and Partial participation
  • 46. Extended E-R Features • Specialization • Generalization • Higher- and lower-level entity sets • Attribute inheritance • Aggregation
  • 47. Specialization • An entity set may include subgroupings of entities that are distinct in some way from other entities in the set. • The process of designating subgroupings within an entity set is called specialization • The specialization of person allows us to distinguish among person entities according to whether they correspond to employees or students • The specialization relationship may also be referred to as a superclass-subclass relationship • Example :The university could create two specializations of student, namely graduate and undergraduate – Overlapping specialization – Disjoint specialization
  • 48. Specialization (Contd.. ) • For an overlapping specialization (as is the case for student and employee as specializations of person), two separate arrows are used. • For a disjoint specialization (as is the case for instructor and secretary as specializations of employee), a single arrow is used
  • 49. Generalization • Generalization proceeds from the recognition that a number of entity sets share some common features (namely, they are described by the same attributes and participate in the same relationship sets)
  • 51. Attribute Inheritance • Attribute inheritance: allows lower level entities to inherit the attributes of higher level entities and vice versa • Example: Car entity is an inheritance of Vehicle entity ,So Car can acquire attributes of Vehicle • Example:car can acquire Model attribute of Vehicle
  • 52. Aggregation • An ER diagram is not capable of representing the relationship between an entity and a relationship which may be required in some scenarios • In those cases, a relationship with its corresponding entities is aggregated into a higher-level entity • Aggregation is an abstraction through which we can represent relationships as higher-level entity sets • For Example, an Employee working on a project may require some machinery • So, REQUIRE relationship is needed between the relationship WORKS_FOR and entity MACHINERY • Using aggregation, WORKS_FOR relationship with its entities EMPLOYEE and PROJECT is aggregated into a single entity and relationship REQUIRE is created between the aggregated entity and MACHINERY.
  • 54. Symbols used in ER notation