Audit advanced Works with: Any AI

SQL Schema Constraints and Data Type Quality Review

Table output

Audit table definitions for missing keys, weak data types, absent constraints and naming problems that cause bad data later.

The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.

[VERIFY] is an editorial flag, not a blank to fill. Wherever the prompt shows [VERIFY], check that item against a reliable source before you use it.

Rate this prompt

Loading ratingsโ€ฆ

Review the design quality of the tables I paste. Database: [DATABASE_TYPE]. CREATE TABLE statements or a column list: [TABLE_DEFINITIONS]. How the data is used: [USAGE_DESCRIPTION]. Approximate row counts and growth: [ROW_COUNTS].

Check and report: 1) A table with the columns Table, Column, Issue (no primary key, missing foreign key, money stored as floating point, dates stored as text, overly wide text, missing NOT NULL, no unique constraint on a natural key, no check on allowed values, unclear name, inconsistent naming), Risk if left, and Suggested change. 2) Counts of tables with and without primary keys, columns that allow NULL, and columns that look like they hold repeated groups. 3) A list of relationships you infer between tables, flagged where no constraint enforces them. 4) A risk-ordered change list, separating low-risk additions (a new check) from risky ones (changing a data type on a large table). 5) A migration caution note: how to check existing data against a new constraint before adding it.

Rules: infer carefully and label every inference as an assumption; do not claim the data is bad, only that the design allows it. Data type names and constraint syntax vary by database, so mark specifics [VERIFY] for [DATABASE_TYPE]. Do not produce destructive scripts; give read-only check queries first. Recommend backups and review by the database owner.

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.

Related prompts