Referential Integrity Explained: Bonding Tables Together
(Page 1 of 4 )
Referential integrity is important to any database design. Why is it so important, and how does it work? Alf Pedersen defines the phrase and spells out why you wouldn't want to build a database without it.
In an ordinary database design, referential integrity is a key component. Have you ever wondered what this term really means? I have. Let's explore Referential Integrity together. But first, get yourself a cup of coffee, as we need to work a little on this topic.
First, let's break up this phrase. This is always a smart thing to do; if you can't see it all at once, break it down until you can study a small part of the problem which you can see.
Looking up the word referential in a dictionary yields an explanation something like this:
Ref`er*en"tial: Containing a reference; pointing to something out of itself;
Hmm, something outside itself...not contained inside, but outside. Now, let us check our integrity: A new lookup gives us the following:
The state of being unimpaired; soundness. The quality or condition of being whole or undivided; completeness.
I really like that one. That means something is not broken, but sound and complete.
Referential integrity means just that pointers from something to something outside itself are sound and unbroken.
In database design, the term referential integrity simply means that if a row in a table has a pointer to a row in another table, the row in the table that is pointed at, must be sound (exist). Put another way, you should not remove a row which contains information that other row(s) depend on.
Next: Examples >>
More Database Articles
More By Alf Pedersen