CompTIA Tech+ (FC0-U71)Data and Database FundamentalsMedium
An Orders table has a CustomerID foreign key that references the CustomerID primary key in the Customers table. A technician attempts to insert a new order with a CustomerID value that does not exist in the Customers table, and the database rejects the insert. Which concept caused this rejection?
- AComposite key
- BNormalization
- CReferential integrity
- DData redundancy
Show answer & explanationAnswer & explanation
Correct answer: C. Referential integrity
Referential integrity ensures that a foreign key value must correspond to an existing primary key value in the related table, preventing orphaned records. Normalization reduces redundancy, data redundancy is duplicated data, and a composite key uses multiple columns as a key.
Why the other options are wrong
- A. A composite key uses two or more columns together as a key, unrelated to this scenario.
- B. Normalization is about organizing tables to reduce redundancy, not enforcing valid references.
- D. Data redundancy refers to unnecessary duplicated data, not this rejection.
Referential Integrity
A database rule that ensures foreign key values always match an existing primary key value in the related table, preventing orphaned or invalid references.
- Enforced through foreign key constraints
- Prevents inserting child records with non-existent parent keys
- Also prevents deleting a parent record still referenced by child rows
Memory trick: No orphan orders — every CustomerID needs a matching parent.