Docsity

Relationship Data Model - Database Design - Lecture Slides, Slides of Database Management Systems (DBMS)

Partial preview of the text

Download Relationship Data Model - Database Design - Lecture Slides and more Slides Database Management Systems (DBMS) in PDF only on Docsity!

Entity-Relationship Data Model

Elements of E-R Model

  • In the E/R model, the structure of data is

represented graphically, as an “entity-relationship

diagram,” using three Principal element types:

  • Entity Sets.
    • An entity is an abstract object of some sort, and a collection of similar entities forms an entity set.
  • Attributes
    • The properties of the entities in the set.
  • Relationship
    • The connections among two or more entity Sets

Example of the 3 elements in E/R

Diagram

Entity B

Relationship

Attribute

Entity C

Entity A

Attribute

Attribute

Classification of Constraints

1. Keys

2. Single-value constraints

3. Multi-valued constraints

4. Mapping Cardinalities and Participation

Constraints

Single/Multi-valued attributes

  • Single-valued attributes are attributes that only have

a single value for a particular entity.

  • Multi-valued attributes refers to items that are not

singled-value and Null valued. For example, consider

an employee entity set with the attribute phone-

number. An employee may have zero, one, or several

phone numbers; different employee may have

different numbers of phones.

Stars-in Stars

year

Studios

Movies

length

Title Name Address

fileType owns

Name Address

Participation Constraints

• The participation of an entity set E in a

relationship set R is said to be total , if every

item in E participates in at least one

relationship in R. If only some items in E

participate in relationship R, the participation

of entity set E in relationship R is said to be

partial.

Weak Entity Sets

• There is an occasional condition in which an

entity set’s key is composed of attributes

some or all of which belong to another entity

set. Such an entity set is called a weak entity

set.

Requirements for Weak Entity Sets

  • We cannot obtain key attributes for a weak entity set

indiscriminately. Rather, if E is a weak entity set then

its key consists of:

  • Zero or more of its own attributes, and
  • Key attributes from entity sets that are reached by certain many-one relationship from E to other entity sets. These many-one relationship are called supporting relationships for E.

Discriminator (cont.)

  • Note: although each payment entity is distinct,

payments for different loans may share the same

payment-number. Thus, payment entity set does not

have a primary key; it is a weak entity set.

  • The primary key of a weak entity set is formed by the

primary key of the identifying entity set, plus the

weak entity set’s discriminator.

  • Doted-line = double-line

EMP_DEP Empolyee

Gender

DName

Emp No.

Name

Dependent

Emp No.