thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Data & Analytics · Foundational

Orphan Record

A child row whose foreign key points to a parent row that does not exist.

Definition

Orphan records appear when referential integrity is not enforced, for example in loosely constrained warehouses or after bad deletes. They cause rows to drop out of inner joins and produce inaccurate totals. A LEFT JOIN that filters on a NULL parent key finds them.

Example

SELECT o.* FROM Orders o LEFT JOIN Customers c ON o.CustomerID = c.CustomerID WHERE c.CustomerID IS NULL;

Exam tip

Data-quality questions often expect a LEFT JOIN ... IS NULL anti-join pattern to detect orphans.

Related terms