Data & SQL21 categories
Plan the cleanup of a messy column
Free-text data that half-works and needs to become reliable.
Below is a sample of a messy column. Plan its cleanup. 1. Classify what you see into distinct patterns, with a count or share for each, and give an example of each pattern. 2. Name the ambiguous cases where you genuinely cannot tell the intended value, and say what a human needs to decide. 3. Propose a normalisation order, cheapest and safest first: trim, case-fold, strip punctuation, collapse whitespace, then the harder mappings. 4. Give the SQL or regex for each step, and for each, an example of a value it would wrongly change. 5. Recommend whether to clean on read, clean on write, or add a cleaned column alongside the original. Give one answer. Never silently discard values you cannot parse. Route them to a quarantine bucket and tell me how to count it. Sample values: What the column is supposed to hold:
Making it yours
- Paste your own material where the prompt asks for it. Everything above that line is instruction, not content.
- Delete any rule that does not apply to you. A shorter prompt that fits beats a thorough one that does not.
- If the answer comes back vague, add a line saying what you do not want. Constraints work better than encouragement.
Schema and data quality. Designing tables, migrating them without breaking live code, and cleaning what you have been handed.
Related prompts
Review this schema designBefore you create the tables everyone will depend on for years.Write data quality checks for this tableBefore you trust a table you've just been handed.Write a safe migration for this changeChanging a schema that live code is already reading and writing.Choose the shape for this report's dataDeciding between wide, long, or pre-aggregated before you build anything.Explain this query to me line by lineYou inherited a 200-line query and need to understand it before changing it.Make this slow query fasterA query that used to be fine now takes minutes.
Keep this one
Phrasery saves prompts with a right-click and puts them back the same way. Add this to your own library in one click.
Add to your browser โ free