October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk14 min

How to Set Up Data Quality Checks for a Database

A layered guide to defining data contracts, using database constraints where enforced, testing transformed data, validating schemas and composite keys, and responding to failures.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set up database quality checks in layers: define testable expectations for important data, enforce row-level rules with database constraints where the engine truly supports them, add repeatable tests for transformed data and table relationships, then run those checks before data is published and decide what happens when one fails. The right rules and thresholds come from your data contract and operating history—not generic numbers.

Start with a data contract, not a tool

A data quality check is useful only when it tests an expectation someone actually depends on. Begin with the tables that feed important reports, applications, or downstream models. For each one, identify who owns the data, what consumes it, how records are identified, and when new data is expected to arrive.

As an Amazon Associate I earn from qualifying purchases.

Translate each expectation into a condition that can pass or fail. “Orders should be complete” is too vague; “every order has an order ID, a status from the approved set, and a customer ID that refers to a known customer” is testable. Decide whether each rule applies to every row, to a group of rows, to a relationship between tables, or to the table’s structure.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Required fields: Which fields may be NULL, and which must always have a value?
  • Identity: What makes a row unique—a single column or a combination of columns?
  • Valid values: Which statuses, categories, ranges, or other domains are allowed?
  • Relationships: Which identifiers must match a record in another table?
  • Structure: Which columns and types must exist for downstream users?
  • Delivery: How often should data arrive, and what delay is acceptable?

Record an owner and a response for each important rule as well as its condition. A failed check without a person or process responsible for investigating it is merely an error message. Keep the contract specific enough to guide action, but do not impose rules the business has not agreed to—for example, a field that is legitimately optional should not become mandatory just to make a test pass.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Also record the scope of each expectation. A rule may apply to all rows, only a particular model, or a specific delivery window. Naming the table or model, field or key, expected condition, and responsible owner makes it easier to tell whether a test actually covers the promise. If the producer changes a valid status or delivery pattern, update the contract and the associated tests intentionally rather than letting an old test become a source of unexplained alerts.

Choose the right layer for each rule

Database constraints and automated data tests serve related but different purposes. A database constraint can reject invalid writes when the database enforces it. A transformation-layer test can examine the result of a model build, including rules that span modeled tables. Neither layer universally replaces the other: enforcement, available rule types, and operational behavior depend on the database and the workflow.

Check layer When it runs Useful for Important limitation
Database constraint When a row is inserted or updated, if the engine enforces the constraint Required fields, identifiers, references, and supported row-level conditions Support and enforcement vary by platform; verify actual behavior in the database documentation
Transformation or model test As part of a data-test workflow, commonly after models are built Uniqueness, null checks, accepted values, relationships, and checks on modeled output It detects issues when the test runs; it does not necessarily prevent an upstream write
Schema or compound-key validation At the point in the workflow where the chosen validation is configured Required structure and identity that spans multiple columns Implementation depends on the framework and how it is integrated
Freshness or volume monitoring On the schedule used to assess delivery or dataset behavior Unexpected delay or changes in row volume Useful thresholds require the source’s cadence or an established baseline

Compare layers by more than the rule name. Ask when each check runs, what kinds of conditions it can express, whether it can examine relationships across tables, how the platform enforces it, how a failure is surfaced, and what it costs to run against the size of your tables. A write-time constraint can stop a particular invalid write if enforced; a transformation test can report on a built result but may run after upstream data has already landed. Use both where the distinct protections matter.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some systems allow a declared constraint without enforcing it in the way an operator expects. The dbt constraints documentation notes that enforcement varies across platforms and describes PostgreSQL as supporting standard constraints and row-level CHECK constraints. That is not a guarantee for another database, nor a substitute for checking the precise engine, version, and constraint behavior you use. Confirm those details in your database’s own documentation before relying on a declaration to stop bad writes.

Enforce write-time invariants where supported

Use native constraints for rules that should apply whenever data is written to a table and that the database can reliably enforce. Common SQL examples include NOT NULL for required fields, PRIMARY KEY or UNIQUE for identifiers, FOREIGN KEY for references, and CHECK for a row-level condition such as a nonnegative quantity. These are familiar SQL constraint types, not a promise that every engine supports or enforces each declaration identically.

Match the constraint to the rule

  • NOT NULL: Use it only when the field is genuinely required. If “unknown” is a valid state, allow NULL and define any separate handling the consumer needs.
  • PRIMARY KEY or UNIQUE: Select the rule that matches the table’s identity and the database’s semantics. A uniqueness declaration on one column does not establish uniqueness for a multi-column identity.
  • FOREIGN KEY: Use it when a reference must resolve and the platform enforces that relationship for your workload. Consider the implications for loading order and updates.
  • CHECK: Express a row-level rule the engine supports, such as a quantity being zero or greater. Confirm the exact syntax and treatment of NULL in the target engine.

Constraints can prevent some invalid writes rather than merely report them later, but they can also affect ingestion: a load may fail when one row violates a rule. Before enabling one on an existing table, assess the data already present and the impact of rejected writes. Decide how the producer or load process will surface and resolve a rejection. Do not add a constraint based only on its SQL appearance; verify that it is active and behaves as intended on the actual platform.

Distinguish the intended rule from its operational consequence. A required-field constraint may be exactly right for the data contract, yet a batch containing a missing value can fail as a whole or interrupt the load depending on the system and process. Plan how the write path reports the rejection, who investigates it, and whether the source can correct and resend the affected data. That behavior can differ by engine, so confirm it for your database and ingestion path rather than assuming all failed rows are handled alike.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Add repeatable tests to transformed data

When dbt manages your transformations, its built-in generic data tests include unique, not_null, accepted_values, and relationships. dbt recommends testing each model’s primary key for uniqueness and non-nullness. These tests complement database constraints by checking modeled outputs in the workflow where those outputs are produced.

The following is an illustrative dbt-style YAML configuration. Adapt names and syntax to the dbt version installed in your project, and verify it against that version’s documentation:

models:n  - name: ordersn    columns:n      - name: order_idn        data_tests:n          - uniquen          - not_nulln      - name: statusn        data_tests:n          - accepted_values:n              arguments:n                values: ['pending', 'paid', 'cancelled']n      - name: customer_idn        data_tests:n          - relationships:n              arguments:n                to: ref('customers')n                field: id

This example checks four distinct expectations: that order IDs are present, that no order ID is repeated, that statuses belong to a defined set, and that non-NULL customer IDs resolve to an ID in the customer model. The allowed status list is an example contract, not a universal list; use values accepted by the system that owns your data.

In a dbt project, tests are declared on columns, tables, and views through the project’s properties and are run as part of a data-test workflow. Keep the test definitions close to the model contract so a reader can see what is expected of the output. The exact YAML syntax can differ by dbt version, so treat the snippet as a pattern to adapt—not a copy-and-paste guarantee for every installation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Test nullability separately from relationships

A relationship test may exclude NULL values rather than treating them as failed references. In the example, a NULL customer ID can therefore escape the relationship check. If every order must have a customer, the separate not_null test is necessary. If the field is optional, do not add that test merely to duplicate the relationship rule.

Think of a relationship test as answering “for values that are present, do they resolve?” and a nullability test as answering “must a value be present at all?” Keeping those questions separate makes the contract clearer and prevents a passing relationship test from being mistaken for proof that every row has a reference.

This distinction matters when interpreting a green test result. A passing relationship test establishes the tested condition for the non-NULL values it checks; it does not by itself establish that the field is populated on every row. Read the test result in the context of the separate nullability rule and the intended contract.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Check compound identity and table structure

Test uniqueness across all identity columns

Some records are identified by a combination rather than one field. For example, a record may be unique only by the pair (account_id, effective_date). A test that checks account_id alone would incorrectly flag valid multiple dates for one account—or fail to detect repeated account-and-date pairs if the individual columns are not unique. Specify the full combination that defines a record.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Great Expectations documents uniqueness validation across sets of columns. Use an implementation suited to your project’s stack, and make the expected composite identity explicit in the contract. If the database can enforce the corresponding multi-column constraint, that may protect writes; a validation test can still be useful for modeled outputs or where native enforcement is unavailable.

Before writing the test, confirm that the chosen columns really form the business identity and that the expected treatment of NULL values is understood for the selected implementation. A composite test that omits one identity component or checks the wrong grain can produce misleading failures or pass data that violates the actual contract. The objective is not merely to find some unique column; it is to verify uniqueness at the grain consumers rely on.

Validate required structure

Schema checks catch structural changes that row-level checks do not: for example, a required column disappearing or a table no longer matching the structure downstream code expects. Great Expectations documents schema validation for required columns and related structural checks. Decide which schema elements are contractual rather than testing every incidental detail; otherwise, harmless changes can generate noise while important breaking changes remain hard to distinguish.

Structure and values are separate concerns. A table can contain all required columns while still having invalid values, and every value check can pass while a required column has vanished from the output. Include both kinds of checks when consumers depend on both.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Schema checks are most useful when they reflect a consumer requirement: a required field must exist because a downstream model or application depends on it. Keep that list focused on required structure and consider how intentional schema changes are approved and communicated. A schema test should make a breaking change visible, not turn every inconsequential structural detail into an incident.

Run checks before affected data is treated as ready

Place checks after the relevant load or transformation and before the resulting output is published, consumed, or marked ready. For a transformation workflow, include the test step in the same scheduled or deployment process that builds the models. That makes the outcome visible at the point the data is produced, rather than relying on someone to remember a separate manual test.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
  1. Identify the output boundary. Decide which table, model, or publication step must not proceed until its required checks have run.
  2. Build or load the data. Run the check against the version of the data the consumer would actually receive.
  3. Execute the agreed tests. Include the command or job used by your framework in the ordinary schedule or deployment workflow. The exact command and configuration depend on the installed tool and version.
  4. Capture the result. Preserve enough detail to identify the failed rule, affected model or table, and relevant records or counts where the tool provides them.
  5. Apply the rule’s failure policy. Block publication, quarantine affected rows, or alert the responsible owner according to the contract.
  6. Record resolution. Track whether the issue came from a bad source delivery, an intentional schema change, a transformation defect, or an outdated expectation, then update data or contract deliberately.

There is no single schedule or failure policy appropriate for every database. A release-critical identifier rule may need to block an output, while a noncritical anomaly may warrant an alert and investigation. Choose behavior based on the impact of letting affected data through, and make that choice before a failure occurs. dbt’s documentation describes tests and pass/fail results; it does not establish one universal schedule or response policy for all systems.

Use the same workflow to distinguish a failure from an execution gap. A failed check is evidence that a condition was evaluated and did not pass. A job that was skipped, unavailable, or never run provides no such evidence. Track whether checks completed and expose that status to the people responsible for the output; do not let missing execution look like a passing result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Set freshness and volume checks from a baseline

Freshness and row-volume monitoring are useful only when compared with a meaningful expectation. Define acceptable delay from a delivery agreement or the source’s actual cadence. Define expected volume movement and any meaningful change in null rates from a contract or observed operating history. A daily feed and an irregular event stream should not inherit the same threshold simply because both are datasets.

Do not invent a universal freshness limit, row-count percentage, or null-rate threshold. The official documentation considered here does not establish one. Start with the source’s promised delivery pattern and observed behavior, record the rationale for the threshold, and review it if the producer or business process changes. When a check fails, investigate whether the source was late, the load was incomplete, volume legitimately changed, or the data contract is no longer accurate.

Think about these checks as separate signals. Freshness asks whether data arrived within the expected cadence; volume asks whether the amount of data is plausible for that source and period; a null-rate check asks whether completeness has changed. Establish each expected range from the source agreement or operating history and make clear which deviations require blocking, quarantine, or investigation. A threshold without that context can create noise or miss a real problem.

Make failures useful rather than noisy

A check should tell an owner what expectation failed and what action is appropriate. Separate failures by consequence: a violation that makes an output unsafe may block it; a problem that affects only identifiable records may be quarantined; a signal that needs investigation may alert an owner. Quarantine and alerting are policy choices, not automatic properties of a test framework.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Pay attention to the scope and cost of checks on large tables. A full-table validation can take time or use resources, depending on the database, query plan, and framework. No universal cost or performance threshold applies. Measure in your own workload, prioritize checks according to downstream impact, and make sure a faster sampling or narrowed check is not mistaken for a complete guarantee if it does not inspect all relevant records.

  • Route alerts to a named owner or team rather than an unmonitored channel.
  • Distinguish a test failure from a test that did not run; missing execution is not a pass.
  • Keep the failure message connected to the rule and affected output so an operator can triage it.
  • After correcting a problem, rerun the relevant check before treating the output as ready.
  • Review recurring failures for stale assumptions, unstable sources, or a rule that needs a clearer contract.

For each check, decide how much evidence an operator needs to act: the failed condition, the affected table or model, and useful counts or records when the tool makes them available. More detail can make diagnosis faster, but the practical reporting options depend on the framework and database. At a minimum, a notification should point to the rule and owner rather than saying only that a generic job failed.

Common setup mistakes to avoid

  • Assuming a declared constraint is enforced: Verify platform and version behavior in the database documentation and confirm the constraint is active.
  • Testing only whether a reference resolves: Add an independent nullability check when the relationship field is required.
  • Checking the wrong key: Use all columns that define identity when uniqueness is composite.
  • Using arbitrary thresholds: Base freshness, volume, and null-rate expectations on a delivery agreement or operating baseline.
  • Running checks after publication: Put required tests before the output is considered ready, and decide which failures prevent release.
  • Testing structure but not data, or vice versa: Schema and value checks cover different failure modes.
  • Treating a passing test suite as proof of perfect data: Tests verify only the conditions encoded in them, on the data and scope they actually inspect.
  • Confusing a skipped test with a pass: Confirm execution status as well as test outcomes.
  • Ignoring the cost of broad checks: Measure run time and resource use in your own workload without treating a partial check as a full guarantee.

Frequently Asked Questions

Which data quality checks should I start with?

Start with the expectations consumers depend on: required fields, unique identifiers, valid values, references that must resolve, required schema, and delivery cadence. Turn each into a condition that can pass or fail, and identify an owner and response for failures.

Should I use database constraints or data tests?

They address different stages. Enforced database constraints can reject invalid writes, while transformation-layer tests check the data produced by a model or workflow, including accepted values and relationships. Support and enforcement vary by database, so verify actual behavior and use both layers where their distinct protections are useful.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does a relationship test catch NULL foreign keys?

Not necessarily. The dbt property reference says relationship tests automatically exclude NULL values. If the field is required, add a separate not-null test; if it is optional, do not make it required just to satisfy the relationship test.

How do I test a key made from multiple columns?

Define the full identity, such as (account_id, effective_date), and test uniqueness across that set of columns. A single-column uniqueness check does not verify a compound key. Great Expectations documents uniqueness validation across column sets.

What freshness or row-count threshold should I set?

There is no universal threshold established by the cited documentation. Use the source’s delivery agreement or observed operating history to define acceptable delay, volume movement, and meaningful null-rate changes, then review those expectations when the source or process changes.

When should database checks run, and should every failure block publication?

Run checks after the relevant load or transformation and before the affected output is treated as ready. Decide failure behavior by rule: a serious violation may block publication, affected rows may be quarantined, or a less critical signal may alert an owner. No single schedule or failure policy fits every system.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Bottom Line

Build database data quality checks from an agreed contract, enforce supported row-level rules at write time, and test transformed outputs, relationships, compound keys, and required schema. Run the checks before affected data is considered ready, verify they actually executed, and set freshness, volume, and failure policies from the source’s cadence and business impact—not from generic thresholds.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.