TechKnowSurge
CompTIA Tech+ 5.1 CompTIA Tech+ 5.2 NIST NICE K0704 NIST NICE K1147
InteractiveSecurityFree

Which Database Integrity Rule?

Sort database problems and rules into entity, domain, referential or user-defined integrity.

⚑ Complete this interactive to capture a CTF flag worth 5 points.

About this interactive

A database stores records in tables, and a relational database ties tables together, such as a users table and a companies table joined by a third table that links them. If the data in those tables is wrong, names get misspelled in emails, the same company appears three times, and marketing goes to the wrong zip code. The lesson named four kinds of integrity that guard against it. Entity integrity is about the primary key, the ID that identifies each record. It must be unique: two records with the same ID means the database cannot pull the right one. Domain integrity is about the format of each column: every zip code five digits, every state two letters, every quantity a number. Referential integrity is about the links between tables: a record that ties a user to a company needs both of them to exist, so deleting one while the link remains breaks it. User-defined integrity is the rules the business chooses for itself, such as checking a new sign-up's email so the same person is not entered twice. Two pairs are easy to mix up. A duplicate ID is entity integrity, but a duplicate person with two different IDs is a user-defined rule, because the database only knows they are the same person if the business tells it what to check. And a value in the wrong format is domain integrity, while a value pointing to a record that is not there is referential integrity.

What you'll learn

Aligned to

CompTIA Tech+
5.1 Explain database concepts and the purpose of a database.
5.2 Compare and contrast various database structures.
NIST NICE
K0704 Knowledge of database management system (DBMS) principles and practices.
K1147 Knowledge of data integrity principles and practices.

Key terms

Entity Integrity
A database integrity rule requiring that every table has a unique primary key and that the primary key value is never null or duplicated.
Domain Integrity
A database integrity rule that enforces valid entries for a given column by restricting the format, type, and range of values allowed.
Referential Integrity
A database integrity rule that ensures relationships between tables remain consistent, preventing records from referencing non-existent entries in related tables.
User-Defined Integrity
Custom database integrity rules defined by the designer to enforce business-specific requirements not covered by other integrity types.
Primary Key
A unique identifier assigned to each record in a database table that ensures no two rows share the same value.
Relational Database
A type of database that organizes data into related tables and uses defined relationships between those tables to maintain data consistency.
Database Integrity
The overall accuracy, consistency, and reliability of data stored within a database, ensured through entity, domain, referential, and user-defined constraints.

Topics

Database Integrity Databases Interactive Categorize

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →