Data Quality Rules and Constraints Design
Prevent bad data with constraints and validation checks.
The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.
Design data quality rules for [TABLES_OR_DATASET]. Common errors seen: [COMMON_ERRORS]. Systems that write data: [WRITERS]. Database: [DATABASE]. Create rules in three layers: database constraints (not null, unique, check, foreign key), application validation, and scheduled checks for problems that slip through. For each rule give the exact statement or pseudo-code, the error message in plain words and what happens to rejected rows. Return a rules table, ten queries that find existing violations, a plan to fix old data safely with a backup, and a dashboard idea listing counts of violations per day. Warn me before adding constraints that existing data would break. Provide examples of ten checks in plain language, such as every order has a customer, no negative quantities, email addresses contain an at sign and a dot, dates are not in the future when they should not be. Add a recommended severity level for each and a rule for who fixes the data. Describe how to log rejected rows without storing sensitive content longer than necessary and how to trend the number of violations by source system.
Fill in before use
Optional: type your details and the prompt above updates. Nothing is saved or sent.
Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.