Referential Integrity

RGPV: DBMS: Unit 2
 

REFERENTIAL INTEGRITY

 

Referential Integrity ensures that a value that appears in one relation for a given set of attributes also appears for a certain set of attributes in another relation.

 

Example: 

If “CSE” is a branch name appearing in one of the tuples in the College relation (table), then there exists a tuple in the Department relation (table) for branch “CSE”.

 

Example in SQL:

create table customer
(customer-name           char(20),
customer-street            char(30),
customer-city  char(30),
primary key (customer-name))

 

create table depositor
(customer-name           char(20),
account-number          char(10),
primary key (customer-name, account-number),
foreign key (customer-name) references customer)

COMING SOON...

LEAVE A REPLY










Related topics

Please use contact page in this website if you find anything incorrect or you want to share more information about the topic discussed above.