!ntegrity and ACID (1.3.2 e/f) Flashcards
Referential integrity requires…
that if a foreign key is added to a table and a value is entered into a foreign may field the value must exist in the primary key field of another table
Referential integrity foreign key can be..
null to signify that there is no relationship
if null values are not allowed then there must be related record
What is data integrity?
refers to maintaining and ensuring the reliability of data in terms of its accuracy completeness and consistency over its life cycle
What is referential integrity?
refers to the accuracy and consistency of data within a relationship
Data integrity
about ensuring that data is guaranteed to be correct
entity integrity
domain integrity
What is entity integrity?
stipulates that every table must ave a primary key
the primary key for every record of a table must have a unique value and can not be null
What is domain integrity?
means that every attribute in a relational database is associated with a domain
Maintaining integrity - cascade delete
use cascade delete when removing a record from a database
ensures that if a record is removed from a table all references to that record are removed from every other table as well
Maintaining integrity - record locking
prevents other users from making changes to a record while you are editing it
prevents data being lost or immediately overridden by accident
can cause deadlock which can be solved by deleting a transaction to clear it