What is data integrity?

Why Interviewers Ask This

Interviewers use this question to quickly assess whether a candidate has the foundational knowledge required for Database Design / Normalization development. It reveals whether you understand the building blocks that more complex concepts rely on.

Answer

Data integrity ensures the accuracy, consistency, and reliability of data throughout its lifecycle. Types: Entity integrity — every table row is uniquely identified (primary key constraint). Referential integrity — foreign key values must match existing primary keys. Domain integrity — column values must be within valid ranges/types (data type, NOT NULL, CHECK constraints). User-defined integrity — business rules enforced via triggers, stored procedures, or application logic. Maintaining data integrity prevents corrupted or inconsistent data from entering the database, which can cause incorrect results and hard-to-debug bugs.

Pro Tip

Before answering, structure your response: one-line definition → real-world analogy → concrete example from a project. This makes even complex Database Design / Normalization answers easy to follow.