in Databases
1,308 views
1 vote
1 vote
How to represent referential integrity constraint in ER model?
pls explain with diagram
in Databases
by
1.3k views

4 Comments

@srestha

check slide 13 and slide 14 of the IIT link

is that diagram of ER model or relational model?

 

0
0

@aditi19

that is for relational model or for tables.

In ER diagram , we just takes attributes of tables, but not it's values.

right?

Then why foreign key will require here?

Foreign key depend on values of primary key. right??

If primary key value doesnot exists, then foreign key also non-existent.

So, not reuire for ER diagram.

Hope it is clear now.

0
0
ok cool
0
0

1 Answer

2 votes
2 votes

Well there is no concept of referential integrity constraint during 1st phase of design: ER modeling. Referential integrity is implicitly understood and we can have an intuition of it during ER modeling. Normally, Integrity Constraints (IC) are realized during 2nd phase of design i.e. Relational Design phase (in laymen terms- Table making phase). 

Intuitively, you can understand referential integrity constraint in ER model as follows-

First of all you need to understand what is Referential Integrity Constraint means: A foreign key constraint (also referred to as a referential constraint or a referential integrity constraint) is a logical rule about values in one or more columns in one or more tables. So, for an example, referential integrity constraint can be visualized in ER diagram as: Weak Entity (Loan) having total participation with the identifying relationship (Borrow). Dependent entity: Loan has a Foreign Key which is actually a Primary Key of identifying entity: Customer entity. If you convert above diagram into Relational Model, then it will look like this: 

Customer (PK1, Attribute 1, Attribute 2,...) 

Loan (FK, Attribute 3, Attribute 4, Attribute of Borrow, if any, .....) 

So, FK in Loan is a referential integrity key constraint. 

edited by

1 comment

yes foreign key acts referential integrity contraints.
0
0