SlideShare a Scribd company logo
1 of 37
Chapter 2: Conceptual Design
Presented By
Prof.Ugalmugale S.T.
 An entity-relationship (ER) diagram is a specialized
graphic that illustrates the interrelationships
between entities in a database.
 ER diagrams often use symbols to represent three
different types of information, namely, entities,
attributes and relationships.
Entity-Relationship Model
 Define Entities: These are usually nouns used in
descriptions of the system, in the discussion of business
rules, or in documentation; identified in the narrative.
 Define Relationships: These are usually verbs used in
descriptions of the system or in discussion of the
business rules (entity entity); identified in the
narrative.
 Add attributes to the relations: These are determined by
the queries, and may also suggest new entities, e.g.
grade; or they may suggest the need for keys or
identifiers.
How do we start ERD
 Entity
 An entity is an object or concept about which you want to store
information.
 Key attribute
 A key attribute is the unique, distinguishing characteristic of the
entity. For example, an employee's social security number might
be the employee's key attribute.
ER Diagram Symbols
 Relationships
 Relationships illustrate how two entities share information in the
database structure.
 Weak Entity
 A weak entity is an entity that must defined by a foreign key
relationship with another entity as it cannot be uniquely identified
by its own attributes alone.
ER Diagram Symbols
 Derived attribute
 A derived attribute is based on another attribute. For example, an
employee's monthly salary is based on the employee's annual
salary.
 Multivalued attribute
 A multivalued attribute can have more than one value. For
example, an employee entity can have multiple skill values.
ER Diagram Symbols
 Cardinality specifies how many instances of an entity relate to one instance
of another entity.
 Ordinality is also closely linked to cardinality.
 While cardinality specifies the occurrences of a relationship, ordinality
describes the relationship as either mandatory or optional.
 In other words, cardinality specifies the maximum number of relationships
and ordinality specifies the absolute minimum number of relationships.
 When the minimum number is zero, the relationship is usually called
optional and when the minimum number is one or more, the relationship is
usually called mandatory.
How to express Relationships
Relationship Symbols
*Example of schema in the entity- relationship model
Entity-Relationship Model
 E-R model of real world
◦ Entities (objects)
 E.g. customers, accounts, bank branch
◦ Relationships between entities
 E.g. Account A-101 is held by customer Johnson
 Relationship set depositor associates customers with
accounts
 Widely used for database design
◦ Database design in E-R model usually converted to
design in the relational model (coming up next) which is
used for storage and processing
Entity Relationship Model (Cont.)
 Specification notation for defining the database
schema
◦ E.g.
create table account (
account-number char(10),
balance integer)
 DDL compiler generates a set of tables stored in
a data dictionary
 Data dictionary contains metadata (i.e., data
about data)
Data Definition Language (DDL)
 A database can be modeled as:
◦ a collection of entities,
◦ relationship among entities.
 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
Entity Sets
Entity Sets ‘customer ‘ and ‘loan’
customer-id amount
customer- customer- customer-
name street city
loan-
number
 Express the number of entities to which another
entity can be associated via a relationship set.
 Most useful in describing binary relationship sets.
 For a binary relationship set the mapping
cardinality must be one of the following types:
◦ One to one
◦ One to many
◦ Many to one
◦ Many to many
Mapping Cardinalities
Mapping Cardinalities
One to one One to many
Note: Some elements in A and B may not be mapped to any
elements in the other set
Mapping Cardinalities
Many to one Many to many
Note: Some elements in A and B may not be mapped to any
elements in the other set
Mapping Cardinalities affect ER Design
n Can make access-date an attribute of account, instead of a
relationship attribute, if each account can have only one customer
n I.e., the relationship from account to customer is many to one,
or equivalently, customer to account is one to many
E-R Diagrams
n Rectangles represent entity sets.
n Diamonds represent relationship sets.
n Lines link attributes to entity sets and entity sets to relationship sets.
n Ellipses represent attributes
n Double ellipses represent multivalued attributes.
n Dashed ellipses denote derived attributes.
n Underline indicates primary key attributes (will study later)
E-R Diagram With Composite, Multivalued,
and Derived Attributes
Relationship Sets with Attributes
 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.
 E.g.: One-to-one relationship:
◦ A customer is associated with at most one loan via the
relationship borrower
◦ A loan is associated with at most one customer via
borrower
Cardinality Constraints
 In the one-to-many relationship a loan is
associated with at most one customer via
borrower, a customer is associated with several
(including 0) loans via borrower
One-To-Many Relationship
 In a many-to-one relationship a loan is
associated with several customers via borrower,
a customer is associated with at most one loan
via borrower
Many-To-One Relationships
 A customer is associated with several (possibly
0) loans via borrower
 A loan is associated with several customers via
borrower
Many-To-Many Relationship
Alternative Notation for
Cardinality Limits
n Cardinality limits can also express participation constraints
 Top-down design process; we designate sub groupings
within an entity set that are distinctive from other entities
in the set.
 These sub groupings become lower-level entity sets that
have attributes or participate in relationships that do not
apply to the higher-level entity set.
 Depicted by a triangle component labeled IS A (E.g.
customer “is a” person).
 Attribute inheritance – a lower-level entity set inherits all
the attributes and relationship participation of the higher-
level entity set to which it is linked.
Specialization
Specialization Example
 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.
Generalization
Generalization (cont.)
CAR
LicensePlateNo
Price
MaxSpeed
VehicleID
NoOfPassengers
TRUCK
LicensePlateNo
Price
Tonnage
VehicleID
NoOfAxies
VEHICLE
LicensePlateNo
Price
VehicleID
d
CAR
MaxSpeed
NoOfPassengers
TRUCK Tonnage
NoOfAxies
Generalization (Cont..)
 Generalization suppresses the difference among
several entity types, identifying their common
features, and generalize them into a single
superclass of which the original types are special
subclasses.
 The decision as to which process, generalization
or specialization, is more appropriate in a
particular situation is often subjective.
 Can have multiple specializations of an entity set based on
different features.
 E.g. permanent-employee vs. temporary-employee, in
addition to officer Vs secretary Vs teller
 Each particular employee would be
◦ a member of one of permanent-employee or temporary-
employee,
◦ and also a member of one of officer, secretary, or teller
 The IS A relationship also referred to as superclass - subclass
relationship
Specialization and Generalization
 The use of an attribute or entity set to represent an
object.
 Whether a real-world concept is best expressed by an
entity set or a relationship set.
 The use of a ternary relationship versus a pair of binary
relationships.
 The use of a strong or weak entity set.
 The use of specialization/generalization – contributes to
modularity in the design.
 The use of aggregation – can treat the aggregate entity
set as a single unit without concern for the details of its
internal structure.
E-R Design Decisions
E-R Diagram for a Banking Enterprise
Summary of Symbols Used in E-R
Notation
 Primary keys allow entity sets and relationship sets to be
expressed uniformly as tables which represent the contents
of the database.
 A database which conforms to an E-R diagram can be
represented by a collection of tables.
 For each entity set and relationship set there is a unique table
which is assigned the name of the corresponding entity set or
relationship set.
 Each table has a number of columns (generally corresponding
to attributes), which have unique names.
 Converting an E-R diagram to a table format is the basis for
deriving a relational database design from an E-R diagram.
Reduction of an E-R Schema to Tables
 A strong entity set reduces to a table with the
same attributes.
Representing Entity Sets as Tables
End of Chapter 2
Thanks…….

More Related Content

Similar to Chapter 2. Concepctual design -.pptx

Test presentation
Test presentationTest presentation
Test presentationnuvole
 
Conceptual Modeling of Data
Conceptual Modeling of DataConceptual Modeling of Data
Conceptual Modeling of DataM.Zalmai Rahmani
 
Use analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptxUse analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptxMwangaPrayGod
 
ECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptxECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptxmiftah88
 
Presentation of saad on e-r diagram.
Presentation of saad on e-r diagram.Presentation of saad on e-r diagram.
Presentation of saad on e-r diagram.sumit gyawali
 
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 using the entity relationship model
Data modeling using the entity relationship modelData modeling using the entity relationship model
Data modeling using the entity relationship modelJafar Nesargi
 
Dbms ii mca-ch3-er-model-2013
Dbms ii mca-ch3-er-model-2013Dbms ii mca-ch3-er-model-2013
Dbms ii mca-ch3-er-model-2013Prosanta Ghosh
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mcaEdhole.com
 

Similar to Chapter 2. Concepctual design -.pptx (20)

Test presentation
Test presentationTest presentation
Test presentation
 
ER model
ER modelER model
ER model
 
Er model
Er modelEr model
Er model
 
dbms
dbmsdbms
dbms
 
27 fcs157al3
27 fcs157al327 fcs157al3
27 fcs157al3
 
Unit02 dbms
Unit02 dbmsUnit02 dbms
Unit02 dbms
 
dbms er model
dbms er modeldbms er model
dbms er model
 
Conceptual Modeling of Data
Conceptual Modeling of DataConceptual Modeling of Data
Conceptual Modeling of Data
 
database.pptx
database.pptxdatabase.pptx
database.pptx
 
DBMS Class 3
DBMS Class 3DBMS Class 3
DBMS Class 3
 
Use analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptxUse analyzed requirements in the design of database.pptx
Use analyzed requirements in the design of database.pptx
 
L7 er2
L7 er2L7 er2
L7 er2
 
abuukarE r model
abuukarE r modelabuukarE r model
abuukarE r model
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
 
ECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptxECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptx
 
Presentation of saad on e-r diagram.
Presentation of saad on e-r diagram.Presentation of saad on e-r diagram.
Presentation of saad on e-r diagram.
 
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 using the entity relationship model
Data modeling using the entity relationship modelData modeling using the entity relationship model
Data modeling using the entity relationship model
 
Dbms ii mca-ch3-er-model-2013
Dbms ii mca-ch3-er-model-2013Dbms ii mca-ch3-er-model-2013
Dbms ii mca-ch3-er-model-2013
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mca
 

Recently uploaded

Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxyaramohamed343013
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PPRINCE C P
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxpriyankatabhane
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.PraveenaKalaiselvan1
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trssuser06f238
 
Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Nistarini College, Purulia (W.B) India
 
Solution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsSolution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsHajira Mahmood
 
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tantaDashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tantaPraksha3
 
Cytokinin, mechanism and its application.pptx
Cytokinin, mechanism and its application.pptxCytokinin, mechanism and its application.pptx
Cytokinin, mechanism and its application.pptxVarshiniMK
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Patrick Diehl
 
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxpriyankatabhane
 
Twin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptxTwin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptxEran Akiva Sinbar
 
Evidences of Evolution General Biology 2
Evidences of Evolution General Biology 2Evidences of Evolution General Biology 2
Evidences of Evolution General Biology 2John Carlo Rollon
 
Call Girls in Hauz Khas Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Hauz Khas Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Hauz Khas Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Hauz Khas Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Module 4: Mendelian Genetics and Punnett Square
Module 4:  Mendelian Genetics and Punnett SquareModule 4:  Mendelian Genetics and Punnett Square
Module 4: Mendelian Genetics and Punnett SquareIsiahStephanRadaza
 
Heredity: Inheritance and Variation of Traits
Heredity: Inheritance and Variation of TraitsHeredity: Inheritance and Variation of Traits
Heredity: Inheritance and Variation of TraitsCharlene Llagas
 
insect anatomy and insect body wall and their physiology
insect anatomy and insect body wall and their  physiologyinsect anatomy and insect body wall and their  physiology
insect anatomy and insect body wall and their physiologyDrAnita Sharma
 
‏‏VIRUS - 123455555555555555555555555555555555555555
‏‏VIRUS -  123455555555555555555555555555555555555555‏‏VIRUS -  123455555555555555555555555555555555555555
‏‏VIRUS - 123455555555555555555555555555555555555555kikilily0909
 

Recently uploaded (20)

Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docx
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C P
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptx
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 tr
 
Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...
 
Solution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsSolution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutions
 
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tantaDashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
 
Cytokinin, mechanism and its application.pptx
Cytokinin, mechanism and its application.pptxCytokinin, mechanism and its application.pptx
Cytokinin, mechanism and its application.pptx
 
Engler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomyEngler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomy
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?
 
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
 
Twin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptxTwin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptx
 
Evidences of Evolution General Biology 2
Evidences of Evolution General Biology 2Evidences of Evolution General Biology 2
Evidences of Evolution General Biology 2
 
Call Girls in Hauz Khas Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Hauz Khas Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Hauz Khas Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Hauz Khas Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Module 4: Mendelian Genetics and Punnett Square
Module 4:  Mendelian Genetics and Punnett SquareModule 4:  Mendelian Genetics and Punnett Square
Module 4: Mendelian Genetics and Punnett Square
 
Heredity: Inheritance and Variation of Traits
Heredity: Inheritance and Variation of TraitsHeredity: Inheritance and Variation of Traits
Heredity: Inheritance and Variation of Traits
 
insect anatomy and insect body wall and their physiology
insect anatomy and insect body wall and their  physiologyinsect anatomy and insect body wall and their  physiology
insect anatomy and insect body wall and their physiology
 
‏‏VIRUS - 123455555555555555555555555555555555555555
‏‏VIRUS -  123455555555555555555555555555555555555555‏‏VIRUS -  123455555555555555555555555555555555555555
‏‏VIRUS - 123455555555555555555555555555555555555555
 

Chapter 2. Concepctual design -.pptx

  • 1. Chapter 2: Conceptual Design Presented By Prof.Ugalmugale S.T.
  • 2.  An entity-relationship (ER) diagram is a specialized graphic that illustrates the interrelationships between entities in a database.  ER diagrams often use symbols to represent three different types of information, namely, entities, attributes and relationships. Entity-Relationship Model
  • 3.  Define Entities: These are usually nouns used in descriptions of the system, in the discussion of business rules, or in documentation; identified in the narrative.  Define Relationships: These are usually verbs used in descriptions of the system or in discussion of the business rules (entity entity); identified in the narrative.  Add attributes to the relations: These are determined by the queries, and may also suggest new entities, e.g. grade; or they may suggest the need for keys or identifiers. How do we start ERD
  • 4.  Entity  An entity is an object or concept about which you want to store information.  Key attribute  A key attribute is the unique, distinguishing characteristic of the entity. For example, an employee's social security number might be the employee's key attribute. ER Diagram Symbols
  • 5.  Relationships  Relationships illustrate how two entities share information in the database structure.  Weak Entity  A weak entity is an entity that must defined by a foreign key relationship with another entity as it cannot be uniquely identified by its own attributes alone. ER Diagram Symbols
  • 6.  Derived attribute  A derived attribute is based on another attribute. For example, an employee's monthly salary is based on the employee's annual salary.  Multivalued attribute  A multivalued attribute can have more than one value. For example, an employee entity can have multiple skill values. ER Diagram Symbols
  • 7.  Cardinality specifies how many instances of an entity relate to one instance of another entity.  Ordinality is also closely linked to cardinality.  While cardinality specifies the occurrences of a relationship, ordinality describes the relationship as either mandatory or optional.  In other words, cardinality specifies the maximum number of relationships and ordinality specifies the absolute minimum number of relationships.  When the minimum number is zero, the relationship is usually called optional and when the minimum number is one or more, the relationship is usually called mandatory. How to express Relationships
  • 9. *Example of schema in the entity- relationship model Entity-Relationship Model
  • 10.  E-R model of real world ◦ Entities (objects)  E.g. customers, accounts, bank branch ◦ Relationships between entities  E.g. Account A-101 is held by customer Johnson  Relationship set depositor associates customers with accounts  Widely used for database design ◦ Database design in E-R model usually converted to design in the relational model (coming up next) which is used for storage and processing Entity Relationship Model (Cont.)
  • 11.  Specification notation for defining the database schema ◦ E.g. create table account ( account-number char(10), balance integer)  DDL compiler generates a set of tables stored in a data dictionary  Data dictionary contains metadata (i.e., data about data) Data Definition Language (DDL)
  • 12.  A database can be modeled as: ◦ a collection of entities, ◦ relationship among entities.  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 Entity Sets
  • 13. Entity Sets ‘customer ‘ and ‘loan’ customer-id amount customer- customer- customer- name street city loan- number
  • 14.  Express the number of entities to which another entity can be associated via a relationship set.  Most useful in describing binary relationship sets.  For a binary relationship set the mapping cardinality must be one of the following types: ◦ One to one ◦ One to many ◦ Many to one ◦ Many to many Mapping Cardinalities
  • 15. Mapping Cardinalities One to one One to many Note: Some elements in A and B may not be mapped to any elements in the other set
  • 16. Mapping Cardinalities Many to one Many to many Note: Some elements in A and B may not be mapped to any elements in the other set
  • 17. Mapping Cardinalities affect ER Design n Can make access-date an attribute of account, instead of a relationship attribute, if each account can have only one customer n I.e., the relationship from account to customer is many to one, or equivalently, customer to account is one to many
  • 18. E-R Diagrams n Rectangles represent entity sets. n Diamonds represent relationship sets. n Lines link attributes to entity sets and entity sets to relationship sets. n Ellipses represent attributes n Double ellipses represent multivalued attributes. n Dashed ellipses denote derived attributes. n Underline indicates primary key attributes (will study later)
  • 19. E-R Diagram With Composite, Multivalued, and Derived Attributes
  • 21.  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.  E.g.: One-to-one relationship: ◦ A customer is associated with at most one loan via the relationship borrower ◦ A loan is associated with at most one customer via borrower Cardinality Constraints
  • 22.  In the one-to-many relationship a loan is associated with at most one customer via borrower, a customer is associated with several (including 0) loans via borrower One-To-Many Relationship
  • 23.  In a many-to-one relationship a loan is associated with several customers via borrower, a customer is associated with at most one loan via borrower Many-To-One Relationships
  • 24.  A customer is associated with several (possibly 0) loans via borrower  A loan is associated with several customers via borrower Many-To-Many Relationship
  • 25. Alternative Notation for Cardinality Limits n Cardinality limits can also express participation constraints
  • 26.  Top-down design process; we designate sub groupings within an entity set that are distinctive from other entities in the set.  These sub groupings become lower-level entity sets that have attributes or participate in relationships that do not apply to the higher-level entity set.  Depicted by a triangle component labeled IS A (E.g. customer “is a” person).  Attribute inheritance – a lower-level entity set inherits all the attributes and relationship participation of the higher- level entity set to which it is linked. Specialization
  • 28.  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. Generalization
  • 30. Generalization (Cont..)  Generalization suppresses the difference among several entity types, identifying their common features, and generalize them into a single superclass of which the original types are special subclasses.  The decision as to which process, generalization or specialization, is more appropriate in a particular situation is often subjective.
  • 31.  Can have multiple specializations of an entity set based on different features.  E.g. permanent-employee vs. temporary-employee, in addition to officer Vs secretary Vs teller  Each particular employee would be ◦ a member of one of permanent-employee or temporary- employee, ◦ and also a member of one of officer, secretary, or teller  The IS A relationship also referred to as superclass - subclass relationship Specialization and Generalization
  • 32.  The use of an attribute or entity set to represent an object.  Whether a real-world concept is best expressed by an entity set or a relationship set.  The use of a ternary relationship versus a pair of binary relationships.  The use of a strong or weak entity set.  The use of specialization/generalization – contributes to modularity in the design.  The use of aggregation – can treat the aggregate entity set as a single unit without concern for the details of its internal structure. E-R Design Decisions
  • 33. E-R Diagram for a Banking Enterprise
  • 34. Summary of Symbols Used in E-R Notation
  • 35.  Primary keys allow entity sets and relationship sets to be expressed uniformly as tables which represent the contents of the database.  A database which conforms to an E-R diagram can be represented by a collection of tables.  For each entity set and relationship set there is a unique table which is assigned the name of the corresponding entity set or relationship set.  Each table has a number of columns (generally corresponding to attributes), which have unique names.  Converting an E-R diagram to a table format is the basis for deriving a relational database design from an E-R diagram. Reduction of an E-R Schema to Tables
  • 36.  A strong entity set reduces to a table with the same attributes. Representing Entity Sets as Tables
  • 37. End of Chapter 2 Thanks…….