{"success":true,"name":"pick-sql-column-types-from-the-data-s-real-rules","description":"Creating SQL columns and defaulting everything to text.","category":"ai-brimind","path":"ai-brimind/pick-sql-column-types-from-the-data-s-real-rules/SKILL.md","file":"SKILL.md","content":"---\nname: pick-sql-column-types-from-the-data-s-real-rules\ndescription: \"Creating SQL columns and defaulting everything to text.\"\n---\n\n# Pick SQL Column Types From the Data's Real Rules\n\n## When to use\nProject uses SQL, and you are defining columns and tempted to use VARCHAR or TEXT for values that are really numbers, dates, booleans, or enums.\n\n## Example request\nDates stored as strings → sorting puts '10/02' before '02/03'; date types sort and compare correctly by design. 'true'/'false' as VARCHAR → someone writes 'True' and the filter misses it; BOOLEAN removes the spelling problem. Status as free text → five spellings of 'pending' appear; an enum or CHECK constraint fixes the vocabulary. Zip codes as INTEGER → leading zeros vanish; not everything made of digits is a number.\n\n## Instructions\nAct like a type designer who asks what operations the value must support before choosing its container. For each column: ask — will it be compared as a date, computed as a number, filtered as true/false, restricted to a fixed set? Pick the type that makes those operations native (DATE/TIMESTAMP, INTEGER/DECIMAL, BOOLEAN, enum or CHECK), and reserve text for genuinely free text. Watch the reverse trap too: identifiers like phone numbers and zip codes are text that happens to contain digits — math on them is meaningless and leading zeros matter. If unsure about a value's rules, look at real examples of the data before deciding. Only finalize the schema once each type matches how the value is actually used, and explain what class of bad data each choice now rejects.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1063\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}