Data governance
7 min

Data Quality vs Data Integrity: Intact and Right Are Different Tests

Key takeaways

  • Data integrity is whether a record is intact: stored, typed, linked, and changed only by someone allowed to change it. Data quality is whether the record is right for its use, scored on the six dimensions DAMA UK published in 2013. Integrity is a gate in the database. Quality is a percentage from a tool.
  • The three logical forms of integrity, entity, domain, and referential, map to the uniqueness, validity, and consistency dimensions. The constraint checks the value against the schema. The dimension is measured against a definition of the thing.
  • Quality tools have copied the integrity constraints into their rule languages and turned the verdict into a score. AWS Glue's ReferentialIntegrity rule passes, in its own documentation example, at 90 percent.
  • Two tables can be intact and pass every dimension while holding two different things under one name. A foreign key proves the id exists in the referenced table. It says nothing about whether that table and the next system's hold the same kind of thing.
  • The integrity of a definition across databases has one standard. A SHACL shape puts entity, domain, and referential constraints on the concept, validates in every system that holds the data, and returns a report that is itself data.
In this article
Share

A platform lead at an insurer runs the nightly integrity checks on the policy database. Every foreign key resolves. Every primary key is present and unique. Then Finance asks why the renewal report counts 40,000 more customers than the ledger does, and the database has nothing to say. The data quality vs data integrity question starts there. The tables are intact. Whether they are right is a different test, against something the database never held.

Data integrity is whether the data is intact: stored, typed, and linked as the schema says, and changed only by someone allowed to change it. Data quality is whether the data is right for the use it is put to, scored on the six dimensions DAMA UK published in 2013. The first is enforced by constraints in the database. The second is scored by rules in a quality tool. Both are tests on values. Neither says what the values mean.

Integrity asks whether the record survived intact. Quality asks whether the record is right. A foreign key proves that an order points at a row in the customers table. It proves nothing about whether that row is a customer as Finance defines one. That third test, the integrity of a definition across databases, has one standard, and it runs outside both tools.

What is the difference between data quality and data integrity?

The difference is the question, the unit, and the verdict. Integrity is a property of the store, enforced by constraints. It holds or it is broken. Quality is a property of the data in use, scored by rules and reported as the share of records that pass. Our post What Is Data Integrity? A Comprehensive Guide for Enterprises covers integrity in full. Our post What Is Data Quality? covers the six dimensions and what each is measured against.

The difference, question by question

QuestionData integrityData quality
What does it ask?Is the record intact and correctly linked?Is the record right for this use?
Where is it enforced?In the schema and the storage layer, as constraintsIn a quality tool or a pipeline, as rules with thresholds
What is it measured against?The schema and the audit trailA definition of the thing, usually unwritten

What does data integrity check?

Our data integrity post names the forms, and this article uses its definitions. Physical integrity "focuses on protecting the physical storage and transmission of data". Logical integrity "ensures data remains accurate and meaningful within the context of business rules and relationships", and it has three forms.

Three forms of logical integrity, as our integrity post defines them

  • Referential integrity "maintains correct relationships between linked tables, such as ensuring every sales order references a valid customer ID."
  • Domain integrity "ensures data values fall within an acceptable range or format."
  • Entity integrity "guarantees that each record can be uniquely identified, often by requiring a primary key that cannot be null."

Each one is a constraint the database enforces at write time. A row that breaks it never lands. The quality tools have since copied the same checks into their rule languages, and the verdict became a score. AWS Glue's rule language, DQDL, has a ReferentialIntegrity rule that "Checks to what extent the values of a set of columns in the primary dataset are a subset of the values of a set of columns in a reference dataset". Its own example passes at 90 percent: ReferentialIntegrity "zipcode" "reference.zipcode" >= 0.9 (AWS documentation, read 2026-11-26). The database rejects the orphan. The quality tool counts it. Intact is a gate. Right is a percentage.

What does data quality check?

Quality checks the values against a rule, one dimension at a time. The six dimensions in use are the ones DAMA UK published in 2013 and DAMA-DMBOK carries: completeness, uniqueness, timeliness, validity, accuracy, and consistency (DAMA UK, 2013). Three of them resemble the constraints above.

Where the two overlap, and what each is measured against

Integrity constraintNearest dimensionWhat the constraint checksWhat the dimension is measured against (DAMA UK, 2013)
Entity integrityUniquenessThe key is present and unique in this table"how that thing is identified"
Domain integrityValidityThe value fits the column's type, range, or format"the syntax (format, type, range) of its definition"
Referential integrityConsistencyThe key exists in the referenced table"a definition", when "comparing two or more representations of a thing"

The constraint checks the value against the schema. The dimension is measured against a definition of the thing. DAMA UK's paper says the dimensions measure quality "as opposed to defining what the data itself means or represents" (DAMA UK, 2013). So quality assumes something integrity never held: a statement of what the record is. Our post Data Quality Dimensions: The Six, and the One They All Assume takes each dimension to the definition it presupposes.

Can data have integrity and still fail data quality?

Yes, in both directions.

Three cases, and which test catches each

CaseIntegrityQualityCaught by
An order whose customer id points at a deleted customerBrokenFails consistencyA foreign key at write time, or a referential rule afterwards
An address the customer left in 2019, stored perfectlyIntactFails accuracyA reference-data match. No constraint can see it
Finance's customers and Sales' customers, both intact, both passing, two different things under one nameIntactPasses all sixNothing in either tool

The last row is the one this article is about. Both tables are intact. Both pass. An AI agent asked for revenue per customer sees two green scores, joins the tables on an id, and returns a number nobody can defend. The definition was never tested, because nobody wrote one a machine could test. Our post Data Quality for AI Agents: The Dimension No Profiler Measures covers what a passing score tells an agent and what it leaves out. Our post Data Quality Rules: Examples, and Why the Rule Has to Travel writes that last row in six rule languages.

What do the published answers say, and where do they stop?

Every page that holds this query draws the same line. Each is quoted as what its publisher writes.

Two published answers, and where each stops

  • IBM ("Data integrity vs. data quality: Is there a difference?", undated, read 2026-11-26): "Data quality uses those criteria to measure the level of data integrity and, in turn, its reliability and applicability for its intended use." Names entity, referential, and domain integrity, and shows none.
  • Acceldata (Shubham Gupta, 2026-10-21): "Data quality asks whether data is fit for a specific use. Data integrity asks whether trust in that data has been preserved throughout its lifecycle." Shows a foreign key in SQL and stops at the referenced table.

Both are right about the first difference. None asks the next one. A foreign key proves the id exists in the customers table. Whether that table and the accounts table in the next system hold the same kind of thing is a question about the definition, and the key has no field for it. Referential integrity inside one database and the integrity of a definition across databases are different checks. Only the second has a standard.

What is the integrity of a definition across databases?

It is the test that the thing a key points at is the thing the definition says it is, in every system that holds it. A database cannot run it, because the definition lives outside the schema. A quality tool cannot run it, because its rules are booleans on columns. Every tool can score the values. None of them can say what the column means. The one rule language built for this test is SHACL, the W3C Shapes Constraint Language, "a language for validating RDF graphs against a set of conditions" (W3C Recommendation, 20 July 2017). Our post What Is SHACL? explains the language. Its constraints are the three integrity forms, lifted from the table to the concept.

The three integrity forms, as SHACL constraints on the concept

Integrity formDatabase constraintSHACL constraint, in the specification's words
EntityPrimary key, unique and not nullsh:minCount "specifies the minimum number of value nodes that satisfy the condition", on the identifier of every instance of the class
DomainColumn type, check constraintsh:datatype "specifies a condition to be satisfied with regards to the datatype of each value node"
ReferentialForeign key to a tablesh:class: "each value node is a SHACL instance of a given type". The type is a concept in the model, with a shape of its own

The shape below follows the specification's own example. It says a customer has at least one billed account, and that the account is an Account as the model defines one.

ex:CustomerShape
    a sh:NodeShape ;
    sh:targetClass ex:Customer ;
    sh:property [
        sh:path ex:billedAccount ;
        sh:class ex:Account ;
        sh:minCount 1 ;
    ] .

Point Finance's table and Sales' table at that shape and run it. Each record conforms or fails, in both systems, against one definition. The result is itself RDF: "The validation report is the result of the validation process that reports the conformance and the set of all validation results" (W3C, 2017). So the shape can carry its approver and review date as properties of itself. Our post How to Validate an Ontology with SHACL walks through a run. Our post Metadata Quality: How to Measure It and What to Do About It does the same for the record about the data. Our post Data Product vs Data Contract: A Contract Is Not a Definition covers the link a contract leaves open for this definition, and our post What Is Data Governance for AI? covers the layer that owns it.

Where does TopQuadrant fit?

Your database keeps the keys. Your quality tool keeps the scores. TQ Data Foundation holds the third thing: the governed definition of the concept, on RDF, OWL, and SHACL, with a named owner, a version, and the shape that tests records against it. Every definition is validated with SHACL, a standard TopQuadrant helped author, enforced in the data as policy-as-code and validation rules. AI proposes the model and the mappings; your experts confirm them. Validated data publishes automatically. Your catalog stays, and it syncs. Everything is RDF, SKOS, OWL and SHACL, exportable in full at any time.

Run your integrity checks tonight and let them pass. Then take the busiest foreign key in the estate and ask what the referenced table holds. If the answer is a table name, the definition lives nowhere. TopQuadrant is where it lives, with the shape that tests it.

Give your AI the context it's been missing

See how the TQ Data Foundation turns your enterprise knowledge into trusted, Al-ready context.