0% found this document useful (0 votes)
12 views

CSE303 Lecture05-06 ERD02 2023

Uploaded by

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

CSE303 Lecture05-06 ERD02 2023

Uploaded by

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

Departmen Computer

CSE Science
t of &Engineering

Entity Relationship Diagram

Lecture 05-06
CSE 303: Database Management
System
Relationships
● Relationship Types vs. Relationship Instances
● A meaningful association between (or among) entity
types.
● An association between (or among) entity instances
where each relationship instance associates exactly
one entity instance from each participating entity
type.
● Relationships can have attributes
● These describe features pertaining to the association between
the entities in the relationship
Relationship instances
Degree of Relationships
● Degree of a Relationship is the number of entity

types that participate in a relationship.


● Unary Relationship A relationship between instances
of a single entity type.
● Binary Relationship A relationship between the
instances of two entity types.
● Ternary Relationship A simultaneous relationship
among the instances of three entity types
Relationship Degree
Unary Relationship
Binary Relationship
Ternary Relationship
Cardinality of Relationships
● One – to – One
● Each entity in the relationship will have exactly one
related entity
● One – to – Many
● An entity on one side of the relationship can have
many related entities, but an entity on the other side
will have a maximum of one related entity
● Many – to – Many
● Entities on both sides of the relationship can have
many related entities on the other side
Cardinality Constraints
● Cardinality Constraints - A rule that specifies the

number of instances of one entity that can (or must)


be associated with each instance of another entity.
● Minimum cardinality The minimum number of
instances of one entity that may be associated with
each instance of another entity.
● Maximum cardinality The maximum number of
instances of one entity that may be associated with
each instance of another entity.
Relationship cardinality

Mandatory Optional
One One

Mandatory Optional
Many Many
Cardinality constraints in a ternary relationship
Modeling Time-Dependent Data
● Time stamp A time value that is associated with a

data value, often indicating when some event


occurred that affected the data value.
Product assignment to product line over time
Modeling Multiple Relationships Between Entity Types
Associative entity
● Associative entity An entity type that associates the
instances of one or more entity types and contains
attributes that are particular to the relationship
between those entity instances.
An associative entity
Naming and Defining Relationships
● A relationship name is a verb phrase. Relationships
represent actions being taken, usually in the present tense,
so transitive verbs. A relationship name states the action
taken, not the result of the action. The name states the
essence of the interaction between the participating entity
types, not the process involved.

● You should avoid vague names, such as Has or Is Related


To. Use descriptive, powerful verb phrases, often taken
from the action verbs found in the definition of the
relationship.
Guidelines for defining relationships
● explains what action is being taken and possibly why it is important.

● give examples to clarify the action.

● optional participation.

● explain the reason for any explicit maximum cardinality

● explain any mutually exclusive relationships.

● explain any restrictions on participation in the relationship.

● explain the extent of history that is kept in the relationship.

● explain whether an entity instance involved in a relationship instance can

transfer participation to another relationship instance


Thank You

You might also like