Entity-Relationship Model
Entity-Relationship Model
Entity-Relationship Model
1
Customer CAB Account
Branch
CustAcc
Customer Account
t
The notation of an entity set and a relationship set is not a precise one.
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
E-name E-no
Manager
Employee Works-for
Worker
- A weak entity set is indicated in E-R diagrams by doubly
outlined box.
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
uses
Machinery
id
uses
Machinery
id