Entity-Relationship Model

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

Entity-Relationship model:

The E-R data model is based on a perception of real world which


consists of basic objects called entities and relationships among these
objects
 Entity
 Entity set
 Attributes
 Domain of an attribute
 Relationship
 Relationship set
Binary Relationship Set

Street city Acct-no. Balance


Cname

SS-no. Customer CustAcct Account

1
Customer CAB Account

Branch

Ternary Relationship Set

 A relationship may also have descriptive attributes.


.,
date

CustAcc
Customer Account
t

 The notation of an entity set and a relationship set is not a precise one.

E-name Phone-No E-name Phone-No Loc

Emp
Employee Employee Phn Phone
2
Existence dependencies: If the existence of the entity x
depends on the existence of the entity y, then x is said to be
existence-dependent on y.
Keys:
 Super key:
 Candidate key:
 Primary key:
 Weak Entity set :
 Strong Entity set :
 Discriminator of a weak entity set :
• Primary key of weak Entity set :
• Attribute set of relationship :
• Primary key of relationship set:

3
E-R diagram: It expresses the structure of a database graphically.
 Rectangles
 Ellipses
 Diamonds
 Lines

Mapping Constraints:
Mapping cardinalities in binary relationships
i. One-to-one
ii. One-to-many
iii. Many-to one
iv. Many-to-many

4
a) One-to-many relationship:

b) Many-to-one

c) One-to-one
Customer CustAcc Account

Cust
Customer Acct Account

Cust
Customer Acct Account 5
d)Many-to-many:
Cust
Customer Account
Acct

-Roles are indicated in E-R diagrams by labeling the lines

E-name E-no

Manager
Employee Works-for
Worker
- A weak entity set is indicated in E-R diagrams by doubly
outlined box.

Acct-no balance Tran-no date


amt

Account log Transaction 6


Reducing E-R Diagrams to Tables:
• A database which conforms to an E-R diagram can be represented by a
collection of tables.
• Representation of strong Entity sets:
• Representation of weak entity sets:
• Representation of relationship:
Generalization:
Saving-account(with interest rate)
Account - Extend
Current-account(with overdraft-amount)
acct-no balance

Account

IS A

Saving-account Current-account

Interest-rate Overdraft-amount 7
• Aggregation : One limitation of the E-R model is that it is not
possible to express relationships among relationships

name id hours number


e.g.,

Employee work project

uses

Machinery

id

Solution === aggregation.


Aggregation is an abstraction through which relationships are
treated as higher-level entities. 8
Work

name id hours number

Employee work project

uses

Machinery

id

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy