- Published: September 15, 2022
- Updated: September 15, 2022
- University / College: Michigan State University
- Level: Undergraduate
- Language: English
- Downloads: 27
ID # What are “ referential integrity constraints”? Provide an example Referential integrity is an important feature of databases that ensures consistent associations among database tables. When one database table comprises a FK (foreign key) to any other table, the idea of referential integrity outlines that we cannot insert a record to the database table that holds the foreign key unless there is an equivalent record in the associated table. Additionally, it also comprises methods for example cascading delete and cascading update; to make sure transformations are formulated to the associated tables are revealed in the primary table (Chapple) and (Microsoft).
In addition, referential integrity offers techniques to deal with relationships among tables. In this scenario, when we make a table, we can describe constraints to make sure that the data inserted into a specific column has corresponding values in another table. However, there are three kinds of references which can be described in a table: references from another table, references to another table and self-references, that is, references inside the similar table (Sybase).
Moreover, the referential integrity can be explained with a lot of examples: for instance, suppose Table B has a FK that points to a (object) field in a Table A. In this scenario, referential integrity would avoid us from inserting a record to Table B that is not associated with Table A. In addition, referential integrity systems identifies that whenever we delete a record from Table A, some database records in Table B that are associated to the deleted record should also be deleted from the table. This situation is known as cascading delete. Lastly, the referential integrity policy could identify that whenever we change the value of a associated field in Table A, the entire database records in Table B that are associated to it will as well be customized consequently. This is known as the cascading update (Webopedia).
Works Cited
Chapple, Mike. Referential Integrity. 2011. 19 September 2011 .
Microsoft. referential integrity constraint (Entity Data Model). 2011. 20 September 2011 .
Sybase. Specifying referential integrity constraints. 2011. 22 September 2011 .
Webopedia. referential integrity. 2011. 22 September 2011 .