Basic Understanding of Referential Integrity
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Referential Integrityis an optional system of rules that guarantees the relationships are valid and the databases will remain intact as data is entered, edited, or deleted.
Basic RulesFor every record in a child table ( the “many” side) one and only one matching record must be in the parent table ( the “one” side).
Example Look at a Parent/Child relationship.
Without a Parent there is no Child.
Example In order to have a work order you would need a customer that would be receiving the work.
The Customer would be the Parent.
The Work order would be the Child.
Before you can set referential integrity the following conditions must be met.
A one-to-many relationship exists when one table has many records associated with a given value but the related table has only one record for that value.
One Employer------Many Positions
We can’t remove the Employer table because it would delete all of the employers from the Position table.