Referential Integrity

Notice in Figure 2.13 that the only records that match are 4 through 6. If you hook up the two tables with a left join, then you are going to have three dangling records in table B. If table A is Customers and table B is Orders, you have orders without Customers.

Figure 2.13. This diagram shows that table B has no matching records for records 1 through 3 in table A.

Referential integrity states that a value may not be added to a table with a foreign key without a corresponding value existing in the table being referenced. In layman’s terms, a matching value must exist in table A before it can be entered in table B. If ...

Get Access 2002 Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.