Learning outcomes for this page:
Be able to describe referential integrity and the effects this has on creation,
updating and delete action
Below is given a quick refresher of what you should already know. If you do not understand any of it make sure you carry out the exercise given below.
You have Master and child tables.
The master table holds the primary key
The child table holds the foreign key (which has the same value as the primary key in the master table)
What you can and cant do:
You cant create a child record without a master record first existing. The child depends upon the parent.
You cant change a master primary key value (but there are ways around it) because you may loose the link. Some database programs prohibit you from being able to do this by enforcing Referential integrity.
You can change a foreign key value to one whose value exists in the primary key of the master table.
You can only delete a master record if it does not have any child records associated with it (i.e. no foreign keys exist with the same value as the primary key value of the master record you are going to delete)
You can delete any child record
If you did not understand any of the details above please read through, and if you have not done so in the past, and carry out the exercise below.
For: Clinicians | NHS managers | Non healthcare workers
Optional Exercise
Read and work through:
Access practical - Session 2 Relationships
In particular make sure you understand section 7 An introduction to dependency.
The handout is available at: http://www.robinbt2.free-online.co.uk/virtualclassroom/chap8/s2/access2.pdf
Written by Robin Beaumont & Chris Noden e-mail:robin@ieg-net.co.uk or chrisnoden@hotmail.com