{"slug":"aayatai-com-sql-explain-b9a9ef","title":"Explain and sanity-check a SQL query before running it","host":"aayatai.com","method":"POST","resource":"https://aayatai.com/sql/explain","category":"other","description":"Explain and sanity-check a SQL query before running it: statement type, tables touched, syntax problems (quotes, parentheses, = NULL), risky patterns (UPDATE/DELETE without WHERE, DROP, NOT IN with NULLs, cartesian joins, non-sargable filters, multiple statements) and a plain-English explanation. PO","price_listed":0.003,"price_asked":null,"state":"effects","state_label":"Not tested: has real-world effects","checks_7d":0,"answered_7d":0,"latency_ms_median":null,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:137","eip155:42161","eip155:8453","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"dialect":"postgres","sql":"DELETE FROM users WHERE last_login < NOW() - INTERVAL '2 years'"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"properties":{"dialect":{"default":"generic","description":"SQL dialect (used in the explanation).","enum":["postgres","mysql","sqlite","sqlserver","generic"],"type":"string"},"sql":{"description":"The SQL to check.","maxLength":8000,"minLength":5,"type":"string"}},"required":["sql"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"properties":{"explanation":{"type":"string"},"findings":{"description":"error / danger / warning / info, with codes and messages.","items":{"type":"object"},"type":"array"},"statements":{"type":"integer"},"tables":{"items":{"type":"string"},"type":"array"},"type":{"type":"string"},"valid":{"description":"False if a syntax problem was found (heuristic checks, not a full parser).","type":"boolean"},"verdict":{"enum":["ok","review","dangerous","invalid"],"type":"string"}},"required":["valid","type","tables","findings","verdict","explanation"],"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[],"description_full":"Explain and sanity-check a SQL query before running it: statement type, tables touched, syntax problems (quotes, parentheses, = NULL), risky patterns (UPDATE/DELETE without WHERE, DROP, NOT IN with NULLs, cartesian joins, non-sargable filters, multiple statements) and a plain-English explanation. POST {sql, dialect}.","last_updated":"2026-09-28T10:46:22.901Z","schemes":["exact"]}