Foreign key and Referential integrity in RDBMS

Foreign key and Referential integrity in RDBMS

Foreign key and Referential integrity  in RDBMS

Foreign Key

     A key attribute in one table can be a non key attribute in another table .

     Thus foreign key is a field that points to the primary key of another table.

     The purpose of foreign key is to ensure referential integrity.

 Referential Integrity 

       It ensure consistency between tables by defining foreign keys.