0% found this document useful (0 votes)
13 views18 pages

Unit Ii

Uploaded by

Charmila Jesu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views18 pages

Unit Ii

Uploaded by

Charmila Jesu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 18

DBMS

Entity Relationship (E-R)


Model
The Entity Relationship (E-R) Model
 E-R Model Components
 Entities
 In E-R models an entity refers to the entity set.
 An entity is represented by a rectangle containing the
entity’s name.
 Attributes
 Attributes are represented by ovals and are connected to
the entity with a line.
 Each oval contains the name of the attribute it represents.
 Attributes have a domain -- the attribute’s set of possible
values.
 Attributes may share a domain.
 Primary keys are underlined.
 Relationships
The Attributes of the STUDENT Entity
Basic E-R Model Entity Presentation
The Entity Relationship (E-R) Model
 Classes of Attributes
 A simple attribute cannot be subdivided.
 Examples: Age, Sex, and Marital status
 A composite attribute can be further subdivided
to yield additional attributes.
 Examples:
– ADDRESS Street, City, State, Zip
– PHONE NUMBER  Area code, Exchange
number
The Entity Relationship (E-R) Model
 Classes of Attributes
 A single-valued attribute can have only a single value.
 Examples:
– A person can have only one social security number.
– A manufactured part can have only one serial number.
 Multivalued attributes can have many values.
 Examples:
– A person may have several college degrees.
– A household may have several phones with different
numbers
 Multivalued attributes are shown by a double line
connecting to the entity.
The Entity Relationship (E-R) Model
 Multivalued Attribute in Relational DBMS
 The relational DBMS cannot implement multivalued
attributes.
 Possible courses of action for the designer
 Within the original entity, create several new attributes,
one for each of the original multivalued attribute’s
components.
 Create a new entity composed of the original multivalued
attribute’s components
Splitting the Multivalued Attributes into New Attributes
A New Entity Set Composed of Multivalued
Attribute’s Components
The Entity Relationship (E-R) Model
 A derived attribute is not physically stored within the
database; instead, it is derived by using an algorithm.
 Example: AGE can be derived from the data of birth and
the current date.

Figure: A Derived Attribute


The Entity Relationship (E-R) Model
 Relationships
 A relationship is an association between entities.
 Relationships are represented by diamond-shaped
symbols.

Figure :An Entity Relationship


The Entity Relationship (E-R) Model
 A relationship’s degree indicates the number of associated
entities or participants.
 A unary relationship exists when an association is maintained
within a single entity.
 A binary relationship exists when two entities are associated.
 A ternary relationship exists when three entities are associated.
The Entity Relationship (E-R) Model
 Connectivity
 The term connectivity is used to describe the
relationship classification (e.g., one-to-one, one-to-
many, and many-to-many).

Figure :Connectivity in an ERD


The Entity Relationship (E-R) Model
 Cardinality
 Cardinality expresses the specific number of entity
occurrences associated with one occurrence of the
related entity.

Figure :Cardinality in an ERD


The Entity Relationship (E-R) Model
 Relationship Participation
 The participation is optional if one entity occurrence
does not require a corresponding entity occurrence in a
particular relationship.
 An optional entity is shown by a small circle on the side
of the optional entity.

Figure : An ERD With An Optional Entity


Figure : CLASS is Optional to COURSE

Figure : COURSE and CLASS in a Mandatory Relationship


The Entity Relationship (E-R) Model
 Weak Entities
 A weak entity is an entity that
 Is existence-dependent and
 Has a primary key that is partially or totally derived
from the parent entity in the relationship.
 The existence of a weak entity is indicated by a
double rectangle.
 The weak entity inherits all or part of its primary
key from its strong counterpart.
A Weak Entity in an ERD

You might also like