SlideShare a Scribd company logo
Design Model
Entity-Relationship Diagrams
Database
Development
Process
Common Data Models
• We have standard techniques for translating
between data models.
UML/OO ER Relational
class entity type relation/table
object entity tuple/row
attribute attribute attribute/column
association relationship foreign key
key attribute primary key
inheritance inheritance foreign key
Common Data Models
• UML and ER have graphical notations
• very good for conceptual design
• very expressive: capture more application semantics
• Relational model is an implementation model
• not good for conceptual design
• not very expressive: many concepts map to same notation
Entity Types
• Entity types àboxes
Weak entity type à double box
EMPLOYEE
Entity
DEPENDENT
Weak Entity
Entity Types
• Entity types are similar to classes,
they describe potential objects (entities)
that will appear in the database.
• Weak entity types describe dependent entities,
entities that depend on other entities for identity.
EMPLOYEE
Entity
DEPENDENT
Weak Entity
Attributes and Keys
• Attributes àovals
• Key attributes à underlined name
• Partial key attributes àdotted underlined name
Age
Attribute Key Attribute
SSN
Partial Key
Attribute
Date
Attributes and Keys
• Key attributes must be unique for each entity
• Keys are used to identify particular entities
• Partial keys are only partially unique
• used for weak entity types
Age
Attribute Key Attribute
SSN
Partial Key
Attribute
Date
Entity Types and Attributes
• Attributes are connected to entity types by lines
EMPLOYEE Phone
EID
Name
DEPENDENT
Age
Name
Entity Types and Entities
• Entities are instances of an entity type.
Entity Types and Keys
• All regular entity types must
have a key attribute or set of key attributes
• Weak entity types must have partial keys
• Weak entities get part of their key
(and part of their identity)
from some related entity.
Sets and Derived Attributes
• Multivalued attributes à double lined oval
• multivalued = set valued
• that there may be more than one value for the attribute.
• Derived attributes à dashed line ovals
• the attribute is computed from other data
Locations
Multivalued
Attribute
NumEmployees
Derived
Attribute
Composite Attributes
• Composite attributes à tree
• composed of other attributes.
• used for a set of related attributes,
when the set is not a conceptual entity
• the composite doesn’t have identity … it doesn’t have a key
Composite
Attribute
ZipCode
State
Address
Street
City
lecture2.pdf
Relationships
• Relationships à diamonds
• Identifying relationship à double diamond
WorksOn
Relationship Identifying
Relationship
DependentOf
Relationships
• Relationships indicate a meaningful connection
between two entity types
• Relationships may have attributes,
but they cannot have key attributes.
• Identifying relationships connect a weak entity type
to some other entity type
• indicates where the weak entity gets a key
to complete its own partial key
WorksOn
Relationship Identifying
Relationship
DependentOf
Example Schema
EMPLOYEE
Phone
EID
Name
DEPENDENT Age
Name
WorksOn
DependentOf
PROJECT
Budget
Name
StartDate
Participation and Cardinality
• Participation and cardinality
define constraints on relationships
• Participation indicates whether an entity
is required to take part in a relationship
• Cardinality ratios and structural constraints
place limits on the number of entities
that may participate in a relationship
Participation Constraints
• Total participation à double or thick line
• indicates required participation
• Partial participation à thin line
• indicates optional participation
WorksFor
Total Participation
EMPLOYEE DEPARTMENT
WorksOn
Partial Participation
EMPLOYEE PROJECT
Participation Constraints
• Arrowheads can be used to indicate
an upper bound of 1 for participation
• (not used in our textbook)
R
X must participate in exactly one R
X Y
R
X may participate in at most one R
X Y
Cardinality Ratios
• Cardinality ratios specify
the maximum number of relationship instances
that an entity may participate in
Manages
1:1 ratio
EMPLOYEE DEPARTMENT
1 1
WorksFor
n:1 ratio
EMPLOYEE DEPARTMENT
n 1
WorksOn
n:m ratio
EMPLOYEE PROJECT
n m
Structural Constraints
• Structural constraints specify the minimum and
maximum number of relationship instances
that an entity may participate in
WorksFor
An employee must work for exactly 1 department.
A department must have at least 4 employees.
EMPLOYEE DEPARTMENT
(1,1) (4,n)
Manages
An employee may manage at most 1 department.
A department must have exactly 1 manager.
EMPLOYEE DEPARTMENT
(0,1) (1,1)
Participation and Cardinality
• There’s generally numerous ways to express a
relationship constraint.
(0,N) optional participation in any
number of relationships
optional participation in at
most one relationship
required participation in at
least one relationship
required participation in
exactly one relationship
(0,1)
(1,N)
(1,1)
Equivalent Notations
• An employee can manage at most one department.
• A department must have exactly one manager.
Manages
EMPLOYEE DEPARTMENT
(0,1) (1,1)
Manages
EMPLOYEE DEPARTMENT
1 1
Manages
EMPLOYEE DEPARTMENT
Equivalent Notations
• An employee must work for exactly one department.
• A department must have at least one employee.
WorksFor
EMPLOYEE DEPARTMENT
(1,1) (1,n)
n
WorksFor
EMPLOYEE DEPARTMENT
1
WorksFor
EMPLOYEE DEPARTMENT
Relationship Instances
WorksFor
EMPLOYEE DEPARTMENT
(1,1) (1,n)
Each EMPLOYEE instance
is connected to exactly
one WORKS_FOR
instance.
Each DEPARTMENT
instance is connected to
at least one WORKS_FOR
instance.
Relational Roles
• It is sometimes convenient
to name an entity’s role in a relationship.
• particularly useful in recursive relationships
• removes ambiguity in direction of relationship
(0,N) (0,1)
EMPLOYEE
Supervision
supervisor supervisee
Recursive Relationship
(0,N) (0,1)
EMPLOYEE
Supervision
supervisor supervisee
1 = supervisor
2 = supervisee
Notation Summary
lecture2.pdf
lecture2.pdf
Equivalent Schema defined in UML
lecture2.pdf
lecture2.pdf
Design an ER schema for the following enterprise:
lecture2.pdf

More Related Content

PPTX
entityrelationshipmodel.pptx
PPTX
Entity Relationship Model
PPTX
Entityrelationshipmodel
PDF
Dbms Model.pdf
PDF
ER Model in the Database Computer Science.pdf
PPTX
Revision ch 3
PPTX
SBD 05.pptxffefefeefefeefefefefefefefefe
PPT
ERD(2).ppt
entityrelationshipmodel.pptx
Entity Relationship Model
Entityrelationshipmodel
Dbms Model.pdf
ER Model in the Database Computer Science.pdf
Revision ch 3
SBD 05.pptxffefefeefefeefefefefefefefefe
ERD(2).ppt

Similar to lecture2.pdf (20)

PPT
Unit 2 ER Model.ppterfgmefwlgmkldfsmglkdfg
PPTX
Data Models.pptx
PPTX
Database Design and Entity relationship Model.pptx
PPTX
Lecture7.pptx
PPTX
ENTITY RELATIONSHIP DIAGRAM CONCEPTUAL.pptx
PPTX
SQL.pptx
PPTX
Day 1 SQL.pptx
PDF
RDBMS ERD
PPT
Entity relationship diagram (erd)
PPT
Entity relationship diagram (erd)
PPT
Entity relationship diagram (erd)
PPTX
Database part3-
PPTX
PPTX
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
PPTX
database_design_presentation, data base design presenttion
PPTX
UNIT 1-RELATIONAL DATA MODEL for data base subject
PPTX
Entity-Relationship Data Model
PPSX
Cn presentation on the topic called as re modelling
PPT
Database design
Unit 2 ER Model.ppterfgmefwlgmkldfsmglkdfg
Data Models.pptx
Database Design and Entity relationship Model.pptx
Lecture7.pptx
ENTITY RELATIONSHIP DIAGRAM CONCEPTUAL.pptx
SQL.pptx
Day 1 SQL.pptx
RDBMS ERD
Entity relationship diagram (erd)
Entity relationship diagram (erd)
Entity relationship diagram (erd)
Database part3-
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
database_design_presentation, data base design presenttion
UNIT 1-RELATIONAL DATA MODEL for data base subject
Entity-Relationship Data Model
Cn presentation on the topic called as re modelling
Database design
Ad

Recently uploaded (20)

PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Welding lecture in detail for understanding
PPT
Project quality management in manufacturing
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
DOCX
573137875-Attendance-Management-System-original
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
composite construction of structures.pdf
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
Lecture Notes Electrical Wiring System Components
Welding lecture in detail for understanding
Project quality management in manufacturing
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
UNIT 4 Total Quality Management .pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
573137875-Attendance-Management-System-original
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
composite construction of structures.pdf
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
CH1 Production IntroductoryConcepts.pptx
Internet of Things (IOT) - A guide to understanding
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Foundation to blockchain - A guide to Blockchain Tech
Ad

lecture2.pdf

  • 3. Common Data Models • We have standard techniques for translating between data models. UML/OO ER Relational class entity type relation/table object entity tuple/row attribute attribute attribute/column association relationship foreign key key attribute primary key inheritance inheritance foreign key
  • 4. Common Data Models • UML and ER have graphical notations • very good for conceptual design • very expressive: capture more application semantics • Relational model is an implementation model • not good for conceptual design • not very expressive: many concepts map to same notation
  • 5. Entity Types • Entity types àboxes Weak entity type à double box EMPLOYEE Entity DEPENDENT Weak Entity
  • 6. Entity Types • Entity types are similar to classes, they describe potential objects (entities) that will appear in the database. • Weak entity types describe dependent entities, entities that depend on other entities for identity. EMPLOYEE Entity DEPENDENT Weak Entity
  • 7. Attributes and Keys • Attributes àovals • Key attributes à underlined name • Partial key attributes àdotted underlined name Age Attribute Key Attribute SSN Partial Key Attribute Date
  • 8. Attributes and Keys • Key attributes must be unique for each entity • Keys are used to identify particular entities • Partial keys are only partially unique • used for weak entity types Age Attribute Key Attribute SSN Partial Key Attribute Date
  • 9. Entity Types and Attributes • Attributes are connected to entity types by lines EMPLOYEE Phone EID Name DEPENDENT Age Name
  • 10. Entity Types and Entities • Entities are instances of an entity type.
  • 11. Entity Types and Keys • All regular entity types must have a key attribute or set of key attributes • Weak entity types must have partial keys • Weak entities get part of their key (and part of their identity) from some related entity.
  • 12. Sets and Derived Attributes • Multivalued attributes à double lined oval • multivalued = set valued • that there may be more than one value for the attribute. • Derived attributes à dashed line ovals • the attribute is computed from other data Locations Multivalued Attribute NumEmployees Derived Attribute
  • 13. Composite Attributes • Composite attributes à tree • composed of other attributes. • used for a set of related attributes, when the set is not a conceptual entity • the composite doesn’t have identity … it doesn’t have a key Composite Attribute ZipCode State Address Street City
  • 15. Relationships • Relationships à diamonds • Identifying relationship à double diamond WorksOn Relationship Identifying Relationship DependentOf
  • 16. Relationships • Relationships indicate a meaningful connection between two entity types • Relationships may have attributes, but they cannot have key attributes. • Identifying relationships connect a weak entity type to some other entity type • indicates where the weak entity gets a key to complete its own partial key WorksOn Relationship Identifying Relationship DependentOf
  • 18. Participation and Cardinality • Participation and cardinality define constraints on relationships • Participation indicates whether an entity is required to take part in a relationship • Cardinality ratios and structural constraints place limits on the number of entities that may participate in a relationship
  • 19. Participation Constraints • Total participation à double or thick line • indicates required participation • Partial participation à thin line • indicates optional participation WorksFor Total Participation EMPLOYEE DEPARTMENT WorksOn Partial Participation EMPLOYEE PROJECT
  • 20. Participation Constraints • Arrowheads can be used to indicate an upper bound of 1 for participation • (not used in our textbook) R X must participate in exactly one R X Y R X may participate in at most one R X Y
  • 21. Cardinality Ratios • Cardinality ratios specify the maximum number of relationship instances that an entity may participate in Manages 1:1 ratio EMPLOYEE DEPARTMENT 1 1 WorksFor n:1 ratio EMPLOYEE DEPARTMENT n 1 WorksOn n:m ratio EMPLOYEE PROJECT n m
  • 22. Structural Constraints • Structural constraints specify the minimum and maximum number of relationship instances that an entity may participate in WorksFor An employee must work for exactly 1 department. A department must have at least 4 employees. EMPLOYEE DEPARTMENT (1,1) (4,n) Manages An employee may manage at most 1 department. A department must have exactly 1 manager. EMPLOYEE DEPARTMENT (0,1) (1,1)
  • 23. Participation and Cardinality • There’s generally numerous ways to express a relationship constraint. (0,N) optional participation in any number of relationships optional participation in at most one relationship required participation in at least one relationship required participation in exactly one relationship (0,1) (1,N) (1,1)
  • 24. Equivalent Notations • An employee can manage at most one department. • A department must have exactly one manager. Manages EMPLOYEE DEPARTMENT (0,1) (1,1) Manages EMPLOYEE DEPARTMENT 1 1 Manages EMPLOYEE DEPARTMENT
  • 25. Equivalent Notations • An employee must work for exactly one department. • A department must have at least one employee. WorksFor EMPLOYEE DEPARTMENT (1,1) (1,n) n WorksFor EMPLOYEE DEPARTMENT 1 WorksFor EMPLOYEE DEPARTMENT
  • 26. Relationship Instances WorksFor EMPLOYEE DEPARTMENT (1,1) (1,n) Each EMPLOYEE instance is connected to exactly one WORKS_FOR instance. Each DEPARTMENT instance is connected to at least one WORKS_FOR instance.
  • 27. Relational Roles • It is sometimes convenient to name an entity’s role in a relationship. • particularly useful in recursive relationships • removes ambiguity in direction of relationship (0,N) (0,1) EMPLOYEE Supervision supervisor supervisee
  • 28. Recursive Relationship (0,N) (0,1) EMPLOYEE Supervision supervisor supervisee 1 = supervisor 2 = supervisee
  • 35. Design an ER schema for the following enterprise: