What is referential integrity?
Referential integrity is the database rule that a foreign key must always point to an existing row in the referenced table, or be null, preventing orphaned records. It keeps relationships valid, so, for example, no order can reference a customer that does not exist.
Referential integrity is what keeps related data consistent. Enforced through foreign-key constraints, it guarantees that every reference resolves to a real record: delete a customer and the database will either block it, or cascade the change, rather than leave orphaned orders pointing at nothing.
Why it matters:
- Trustworthy joins links between tables actually resolve.
- No orphans child rows always have a valid parent.
- Cleaner analysis counts and joins are not thrown off by dangling references.
In reality, integrity is not always enforced, especially across separate systems that were never designed to reference each other, so orphaned and mismatched records are common.
iDBQuery helps in both worlds. Where referential integrity is enforced, it uses the declared foreign keys to infer correct joins automatically. Where it is not, its federation and semantic layer can still relate records across sources, and you can use plain-language questions to *find* integrity problems, orders with no matching customer, records referencing missing entities, as a data-quality check. Because iDBQuery cites every figure back to source rows, broken relationships surface clearly rather than silently distorting a total. So it both exploits good integrity and helps you detect where it is missing.
Updated 2026-06-22