SlideShare a Scribd company logo
1 of 38
ENTITY-RELATIONSHIP MODEL
E- R DATA MODELING
 An entity is an object that exists and is distinguishable from other
objects.
Example: specific person, company, event, plant
 Entities have attributes
Example: people have names and addresses
 An entity set is a set of entities of the same type that share the same
properties.
Example: set of all persons, companies, trees, holidays
ATTRIBUTES
 An entity is represented by a set of attributes, that is descriptive properties
possessed by all members of an entity set.
Example:
instructor = (ID, name, street, city, salary )
course= (course_id, title, credits)
 Domain – the set of permitted values for each attribute
 Attribute types:
Simple and composite attributes.
Single-valued and multivalued attributes
Derived attributes
TYPES OF ATTRIBUTES
Simple Attribute: Attribute that consist of a single atomic value.
Example: Salary
Composite Attribute : Attribute value not atomic.
Example : Address : ‘House _no:City:State
Name : ‘First Name: Middle Name: Last Name’
TYPES OF ATTRIBUTES
Single Valued Attribute: Attribute that hold a single value
Exampe1: City
Example2:Customer id
Multi Valued Attribute: Attribute that hold multiple values.
Example1: A customer can have multiple phone numbers, email id's etc
Example2: A person may have several college degrees
Derived Attribute: An attribute that’s value is derived from a stored attribute.
Example : age, and it’s value is derived from the stored attribute Date of Birth.
ENTITY SETS INSTRUCTOR AND STUDENT
instructor_ID instructor_name student-ID student_name
RELATIONSHIP SETS
 A relationship is an association among several entities
Example:
44553 (Peltier)
student entity
advisor
relationship set
22222 (Einstein)
instructor entity
8
ENTITY-RELATIONSHIP DIAGRAMS
 Representing entities
we represent an entity by a named rectangle
use a singular noun, or adjective + noun
refer to one instance in naming
PART-TIME
EMPLOYEE
CUSTOMER
ENTITY-RELATIONSHIP DIAGRAMS
 Representing relationship
DEPT EMPLOYEE
employs
ENTITY-RELATIONSHIP DIAGRAMS
 Types of Relationships
Three types of relationships can exist between entities
One-to-one relationship (1:1): One instance in an entity
(parent) refers to one and only one instance in the
related entity (child).
One-to-many relationship (1:M): One instance in an
entity (parent) refers to one or more instances in the
related entity (child)
ENTITY-RELATIONSHIP DIAGRAMS
One to one One to many
ENTITY-RELATIONSHIP DIAGRAMS
 Types of Relationships
Many-to-many relationship (M:N): exists when one instance of
the first entity (parent) can relate to many instances of the
second entity (child), and one instance of the second entity can
relate to many instances of the first entity.
Many to many
CARDINALITY CONSTRAINTS
 We express cardinality constraints by drawing either a directed line
(), signifying “one,” or an undirected line (—), signifying “many,”
between the relationship set and the entity set.
 Or, by numbering each entity. * or, m for many.
 One-to-one relationship:
A student is associated with at most one instructor via the
relationship advisor
A student is associated with at most one department via
stud_dept
1 1
ONE-TO-MANY RELATIONSHIP
 one-to-many relationship between an instructor and a student
an instructor is associated with several (including 0) students via
advisor
a student is associated with at most one instructor via advisor,
1 *
MANY-TO-MANY RELATIONSHIP
 An instructor is associated with several (possibly 0) students via
advisor
 A student is associated with several (possibly 0) instructors via
advisor
* *
16
ENTITY-RELATIONSHIP DIAGRAMS
Crow’s foot notation: A type of cardinality notation. It is
called crow's foot notation because of the shapes, which
include circles, bars, and symbols, that indicate various
possibilities.
A single bar indicates one, a double bar indicates one
and only one, a circle indicates zero, and a crow's foot
indicates many.
17
ENTITY-RELATIONSHIP DIAGRAMS
Crow's foot notation is a common method of indicating cardinality. The four examples
show how you can use various symbols to describe the relationships between entities.
DIFFERENT TYPES OF KEYS
 A candidate key of an entity set is a minimal super key
ID is candidate key of instructor
course_id is candidate key of course
PRIMARY KEY
 A primary key is a candidate key that is most appropriate to be the
main reference key for the table. As its name suggests, it is the primary
key of reference for the table and is used throughout the database to
help establish relationships with other tables.
 The primary key must contain unique values, must never be null
and uniquely identify each record in the table
FOREIGN KEY
A foreign key is generally a primary key from one table that appears as a
field in another where the first table has a relationship to the second. In
other words, if we had a table A with a primary key X that linked to a table B
where X was a field in B, then X would be a foreign key in B
DIFFERENT TYPES OF KEYS
A super key of an entity set is a set of one or more attributes whose
values uniquely determine each entity.
Example:
 {Student ID,FirstName }
 {Student ID, LastName }
 {Student ID,FirstName,LastName}
E-R DIAGRAMS
 Rectangles represent entity sets.
 Diamonds represent relationship sets.
 Attributes listed inside entity rectangle. Or , as oval shape along with the
rectangle.
 Underline indicates primary key attributes
SUMMARY OF SYMBOLS USED IN E-R NOTATION
 E.g., A Class entity cannot exist unless related to a Facultymember
entity
TOTAL PARTICIPATION OF ENTITY SET
WEAK ENTITY SETS
An entity set that does not have a primary key is referred to as a weak entity set
 We underline the discriminator of a weak entity set with a dashed
line.
 We put the identifying relationship of a weak entity in a double
diamond.
 Primary key for section – (course_id, sec_id, semester, year)
Crows feet notation
SUMMARY OF SYMBOLS USED IN E-R NOTATION
SUMMARY OF SYMBOLS USED IN E-R NOTATION
 Rectangle -- Entity
 Ellipses -- Attribute (underlined attributes are [part of] the primary key)
 Double ellipses -- multi-valued attribute
 Dashed ellipses-- derived attribute, e.g. age is derivable from birthdate and
current date.
 Representing attributes
SUMMARY OF SYMBOLS USED IN E-R NOTATION
 Representing attributes
E-R DIAGRAM FOR A UNIVERSITY
Extended ER Features: Generalization
EXTENDED ER FEATURES: GENERALIZATION
 A bottom-up design process – combine a number of entity sets
that share the same features into a higher-level entity set.
 Specialization and generalization are simple inversions of each
other; they are represented in an E-R diagram in the same way.
 The terms specialization and generalization are used
interchangeably.
SPECIALIZATION AND GENERALIZATION (CONT.)
 Can have multiple specializations of an entity set based on different
features.
 E.g., permanent_employee vs. temporary_employee, in addition to
instructor vs. secretary
 Each particular employee would be
a member of one of permanent_employee or temporary_employee,
and also a member of one of instructor, secretary
 The ISA relationship also referred to as superclass - subclass
relationship
UML
 UML: Unified Modeling Language
 UML has many components to graphically model different aspects of
an entire software system
 UML Class Diagrams correspond to E-R Diagram, but several
differences.
FIGURE 7.26
FIGURE 7.29
Thank you

More Related Content

Similar to ERD.pptx

Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide sharefanta teferi
 
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...Mustafa Kamel Mohammadi
 
Data Modeling Er
Data Modeling ErData Modeling Er
Data Modeling Er1ajnabi4u
 
Design issues with constraints of E-R model
Design issues with constraints of E-R modelDesign issues with constraints of E-R model
Design issues with constraints of E-R modelPaurav Shah
 
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...Raj vardhan
 
3. Chapter Three.pdf
3. Chapter Three.pdf3. Chapter Three.pdf
3. Chapter Three.pdffikadumola
 

Similar to ERD.pptx (20)

Er Modeling
Er ModelingEr Modeling
Er Modeling
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide share
 
Unit 2 DBMS
Unit 2 DBMSUnit 2 DBMS
Unit 2 DBMS
 
Data model and entity relationship
Data model and entity relationshipData model and entity relationship
Data model and entity relationship
 
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
 
Data Modeling Er
Data Modeling ErData Modeling Er
Data Modeling Er
 
Design issues with constraints of E-R model
Design issues with constraints of E-R modelDesign issues with constraints of E-R model
Design issues with constraints of E-R model
 
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
 
ERD(2).ppt
ERD(2).pptERD(2).ppt
ERD(2).ppt
 
Data modeling
Data modelingData modeling
Data modeling
 
Er model
Er modelEr model
Er model
 
dbms mannual.pdf
dbms mannual.pdfdbms mannual.pdf
dbms mannual.pdf
 
Chapter3
Chapter3Chapter3
Chapter3
 
Chapter3
Chapter3Chapter3
Chapter3
 
3. Chapter Three.pdf
3. Chapter Three.pdf3. Chapter Three.pdf
3. Chapter Three.pdf
 
ER model
ER modelER model
ER model
 
Er model
Er modelEr model
Er model
 
dbms
dbmsdbms
dbms
 
RDBMS ERD
RDBMS ERDRDBMS ERD
RDBMS ERD
 
27 fcs157al3
27 fcs157al327 fcs157al3
27 fcs157al3
 

More from sarahabbas40

Presentation clod.pptx
Presentation clod.pptxPresentation clod.pptx
Presentation clod.pptxsarahabbas40
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptxsarahabbas40
 
lec24-cloud-computing.ppt
lec24-cloud-computing.pptlec24-cloud-computing.ppt
lec24-cloud-computing.pptsarahabbas40
 
Introduction to Cloud Computing.pptx
Introduction to Cloud Computing.pptxIntroduction to Cloud Computing.pptx
Introduction to Cloud Computing.pptxsarahabbas40
 

More from sarahabbas40 (6)

TSO.ppt
TSO.pptTSO.ppt
TSO.ppt
 
DFD.ppt
DFD.pptDFD.ppt
DFD.ppt
 
Presentation clod.pptx
Presentation clod.pptxPresentation clod.pptx
Presentation clod.pptx
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
 
lec24-cloud-computing.ppt
lec24-cloud-computing.pptlec24-cloud-computing.ppt
lec24-cloud-computing.ppt
 
Introduction to Cloud Computing.pptx
Introduction to Cloud Computing.pptxIntroduction to Cloud Computing.pptx
Introduction to Cloud Computing.pptx
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

ERD.pptx

  • 2. E- R DATA MODELING  An entity is an object that exists and is distinguishable from other objects. Example: specific person, company, event, plant  Entities have attributes Example: people have names and addresses  An entity set is a set of entities of the same type that share the same properties. Example: set of all persons, companies, trees, holidays
  • 3. ATTRIBUTES  An entity is represented by a set of attributes, that is descriptive properties possessed by all members of an entity set. Example: instructor = (ID, name, street, city, salary ) course= (course_id, title, credits)  Domain – the set of permitted values for each attribute  Attribute types: Simple and composite attributes. Single-valued and multivalued attributes Derived attributes
  • 4. TYPES OF ATTRIBUTES Simple Attribute: Attribute that consist of a single atomic value. Example: Salary Composite Attribute : Attribute value not atomic. Example : Address : ‘House _no:City:State Name : ‘First Name: Middle Name: Last Name’
  • 5. TYPES OF ATTRIBUTES Single Valued Attribute: Attribute that hold a single value Exampe1: City Example2:Customer id Multi Valued Attribute: Attribute that hold multiple values. Example1: A customer can have multiple phone numbers, email id's etc Example2: A person may have several college degrees Derived Attribute: An attribute that’s value is derived from a stored attribute. Example : age, and it’s value is derived from the stored attribute Date of Birth.
  • 6. ENTITY SETS INSTRUCTOR AND STUDENT instructor_ID instructor_name student-ID student_name
  • 7. RELATIONSHIP SETS  A relationship is an association among several entities Example: 44553 (Peltier) student entity advisor relationship set 22222 (Einstein) instructor entity
  • 8. 8 ENTITY-RELATIONSHIP DIAGRAMS  Representing entities we represent an entity by a named rectangle use a singular noun, or adjective + noun refer to one instance in naming PART-TIME EMPLOYEE CUSTOMER
  • 9. ENTITY-RELATIONSHIP DIAGRAMS  Representing relationship DEPT EMPLOYEE employs
  • 10. ENTITY-RELATIONSHIP DIAGRAMS  Types of Relationships Three types of relationships can exist between entities One-to-one relationship (1:1): One instance in an entity (parent) refers to one and only one instance in the related entity (child). One-to-many relationship (1:M): One instance in an entity (parent) refers to one or more instances in the related entity (child)
  • 12. ENTITY-RELATIONSHIP DIAGRAMS  Types of Relationships Many-to-many relationship (M:N): exists when one instance of the first entity (parent) can relate to many instances of the second entity (child), and one instance of the second entity can relate to many instances of the first entity. Many to many
  • 13. CARDINALITY CONSTRAINTS  We express cardinality constraints by drawing either a directed line (), signifying “one,” or an undirected line (—), signifying “many,” between the relationship set and the entity set.  Or, by numbering each entity. * or, m for many.  One-to-one relationship: A student is associated with at most one instructor via the relationship advisor A student is associated with at most one department via stud_dept 1 1
  • 14. ONE-TO-MANY RELATIONSHIP  one-to-many relationship between an instructor and a student an instructor is associated with several (including 0) students via advisor a student is associated with at most one instructor via advisor, 1 *
  • 15. MANY-TO-MANY RELATIONSHIP  An instructor is associated with several (possibly 0) students via advisor  A student is associated with several (possibly 0) instructors via advisor * *
  • 16. 16 ENTITY-RELATIONSHIP DIAGRAMS Crow’s foot notation: A type of cardinality notation. It is called crow's foot notation because of the shapes, which include circles, bars, and symbols, that indicate various possibilities. A single bar indicates one, a double bar indicates one and only one, a circle indicates zero, and a crow's foot indicates many.
  • 17. 17 ENTITY-RELATIONSHIP DIAGRAMS Crow's foot notation is a common method of indicating cardinality. The four examples show how you can use various symbols to describe the relationships between entities.
  • 18. DIFFERENT TYPES OF KEYS  A candidate key of an entity set is a minimal super key ID is candidate key of instructor course_id is candidate key of course
  • 19. PRIMARY KEY  A primary key is a candidate key that is most appropriate to be the main reference key for the table. As its name suggests, it is the primary key of reference for the table and is used throughout the database to help establish relationships with other tables.  The primary key must contain unique values, must never be null and uniquely identify each record in the table
  • 20. FOREIGN KEY A foreign key is generally a primary key from one table that appears as a field in another where the first table has a relationship to the second. In other words, if we had a table A with a primary key X that linked to a table B where X was a field in B, then X would be a foreign key in B
  • 21. DIFFERENT TYPES OF KEYS A super key of an entity set is a set of one or more attributes whose values uniquely determine each entity. Example:  {Student ID,FirstName }  {Student ID, LastName }  {Student ID,FirstName,LastName}
  • 22. E-R DIAGRAMS  Rectangles represent entity sets.  Diamonds represent relationship sets.  Attributes listed inside entity rectangle. Or , as oval shape along with the rectangle.  Underline indicates primary key attributes
  • 23. SUMMARY OF SYMBOLS USED IN E-R NOTATION
  • 24.  E.g., A Class entity cannot exist unless related to a Facultymember entity TOTAL PARTICIPATION OF ENTITY SET
  • 25. WEAK ENTITY SETS An entity set that does not have a primary key is referred to as a weak entity set  We underline the discriminator of a weak entity set with a dashed line.  We put the identifying relationship of a weak entity in a double diamond.  Primary key for section – (course_id, sec_id, semester, year)
  • 26. Crows feet notation SUMMARY OF SYMBOLS USED IN E-R NOTATION
  • 27. SUMMARY OF SYMBOLS USED IN E-R NOTATION  Rectangle -- Entity  Ellipses -- Attribute (underlined attributes are [part of] the primary key)  Double ellipses -- multi-valued attribute  Dashed ellipses-- derived attribute, e.g. age is derivable from birthdate and current date.  Representing attributes
  • 28. SUMMARY OF SYMBOLS USED IN E-R NOTATION  Representing attributes
  • 29. E-R DIAGRAM FOR A UNIVERSITY
  • 30. Extended ER Features: Generalization
  • 31.
  • 32. EXTENDED ER FEATURES: GENERALIZATION  A bottom-up design process – combine a number of entity sets that share the same features into a higher-level entity set.  Specialization and generalization are simple inversions of each other; they are represented in an E-R diagram in the same way.  The terms specialization and generalization are used interchangeably.
  • 33. SPECIALIZATION AND GENERALIZATION (CONT.)  Can have multiple specializations of an entity set based on different features.  E.g., permanent_employee vs. temporary_employee, in addition to instructor vs. secretary  Each particular employee would be a member of one of permanent_employee or temporary_employee, and also a member of one of instructor, secretary  The ISA relationship also referred to as superclass - subclass relationship
  • 34.
  • 35. UML  UML: Unified Modeling Language  UML has many components to graphically model different aspects of an entire software system  UML Class Diagrams correspond to E-R Diagram, but several differences.