What is referential integrity constraint

Editorial / Best Answer

Shivani Goel  

  • Member Since Jun-2009 | Jun 23rd, 2009


Referential integrity constraint is that which depend upon the parent and child relationship.  In this one of the column have the primary key constraint and one of the column of another table have the foreign key constraint. So you cannot delete the column value which having the foreign key constraint until you never delete its related primary key column value from parent table. If you tried to do this it will show you error related to referential integrity constraint.   But if you still want to delete value from child table but never want to delete parent table column value then that purpose you can use 'on delete cascade' option.

Showing Answers 1 - 9 of 9 Answers

Nitin Kulkarni

  • Jul 15th, 2005
 

It refers to the integrity between master and detail table. If the information from the master table is deleted then the corresponding record from the detail table should also get deleted as this information has no meaning without master table

  Was this answer useful?  Yes

rajani

  • May 11th, 2006
 

  Referantial integrity deals in parent-child relationship between tables.

 The condition is that the child table must have only the column values that are present in the parent table.  A new value that is not presant in the parent table cannot be updated into the child table. Likewise, an existing value cannot be deletted from the parent table, if the child table consists its corresponding row.

  Was this answer useful?  Yes

Mangai Varma

  • Aug 31st, 2006
 

Referential Integrity Constraint is used to specify interdependencies between relations. This constraint specifies a column or list of columns as a foreign key of the referencing table.

A foreign key means the values in one table must also appear in another table. The foreign key in the child table will generally reference a primary key in the parent table.The referencing table is called the child table & referenced table is called the parent table.

Syntax: constraint <constraint name> references <primary table><primary key>

 

  Was this answer useful?  Yes

Referential integrity constraint is that which depend upon the parent and child relationship.  In this one of the column have the primary key constraint
and one of the column of another table have the foreign key constraint. So you cannot delete the column value which having the foreign key constraint until you never delete its related primary key column value from parent table. If you tried to do this it will show you error related to referential integrity constraint.   But if you still want to delete value from child table but never want to delete parent table column value then that purpose
you can use 'on delete cascade' option.

  Was this answer useful?  Yes

kierthi

  • Aug 16th, 2011
 

A feature provided by relational database management systems (RDBMS's) that prevents users or applications from entering inconsistent data. Most RDBMS's have various referential integrity rules that you can apply when you create a relationship between two tables.

For example, suppose Table B has a foreign key that points to a field in Table A. Referential integrity would prevent you from adding a record to Table B that cannot be linked to Table A. In addition, the referential integrity rules might also specify that whenever you delete a record from Table A, any records in Table B that are linked to the deleted record will also be deleted.

This is called cascading delete. Finally, the referential integrity rules could specify that whenever you modify the value of a linked field in Table A, all records in Table B that are linked to it will also be modified accordingly. This is called cascading update.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions