{"uid":"cap_FQxOaYZ3d03ZLVEgwqdBd","slug":"sql-query-explainer-02e5e339","name":"SQL Query Explainer","description":"Explain a SQL query in plain English. Paste query in message.","url":"https://released-mph-process-lib.trycloudflare.com/v1/sql-explain?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"usage":{"type":"object"},"choices":{"type":"array"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_fatBo7f4BXRO91j4SEb2P","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Accepts a SQL query and returns a plain-English explanation of what the query does","exampleAgentPrompt":"Can you explain what this SQL query does in plain English? SELECT u.name, COUNT(o.id) AS order_count FROM users u LEFT JOIN orders o ON u.id = o.user_id WHERE o.created_at > '2024-01-01' GROUP BY u.name HAVING COUNT(o.id) > 5 ORDER BY order_count DESC;","exampleUseCases":[{"title":"Onboarding junior developer to codebase","prompt":"Can you explain what this SQL query does in simple terms so I can understand the logic? SELECT p.product_name, SUM(oi.quantity * oi.unit_price) AS revenue FROM products p INNER JOIN order_items oi ON p.id = oi.product_id GROUP BY p.product_name ORDER BY revenue DESC LIMIT 10;"},{"title":"Communicating query logic to non-technical stakeholders","prompt":"I need to explain this SQL query to my manager who doesn't know SQL — can you put it in plain English? SELECT customer_id, AVG(order_total) AS avg_spend FROM orders WHERE status = 'completed' AND created_at BETWEEN '2024-01-01' AND '2024-12-31' GROUP BY customer_id HAVING AVG(order_total) > 100;"},{"title":"Debugging an unfamiliar legacy query","prompt":"I inherited this query from a former colleague and I have no idea what it's supposed to do — can you explain it step by step? WITH ranked AS (SELECT *, ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY created_at DESC) AS rn FROM sessions) SELECT * FROM ranked WHERE rn = 1;"}],"resultDescription":"A natural-language explanation of the SQL query, describing what tables are accessed, what filtering or joining logic is applied, what is computed or aggregated, and what the overall result set represents — suitable for developers and non-technical audiences alike.","failureModes":["Missing or empty SQL query in message — returns an error or unhelpful response","Extremely complex or nested queries may produce incomplete or partially accurate explanations","Non-standard SQL dialects (e.g. vendor-specific syntax) may not be fully understood","Malformed or syntactically invalid SQL may yield an error or degraded explanation","Rate limiting or payment failure (x402) may prevent the call from completing"],"whenToPreferThis":"Choose this endpoint when you need a quick, affordable plain-English breakdown of a SQL query without setting up a full LLM pipeline. It is ideal for developer tools, documentation generators, onboarding workflows, or any agent that needs to surface SQL logic to non-technical users. At $0.01 per call it is cost-effective for high-volume use cases where SQL explanation is a recurring need.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-20T12:34:59.448Z","isFirstParty":false,"canonicalSlug":"sql-query-explainer-02e5e339"}