{"uid":"cap_Vdc7XdO0dj2WIy-_jX-k3","slug":"sql-query-explainer-534991f4","name":"SQL Query Explainer","description":"Explain a SQL query in plain English. Paste query in message.","url":"https://biz-integral-pull-earrings.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_VdLsckZJs6d0xOYLYYRNc","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 raw SQL query and returns a plain-English explanation of what it 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 u.created_at > '2024-01-01' GROUP BY u.name HAVING COUNT(o.id) > 5 ORDER BY order_count DESC;","exampleUseCases":[{"title":"Onboarding new developer to codebase","prompt":"I just joined this team and I'm seeing this SQL everywhere — can you explain what it actually does in plain English? SELECT p.title, AVG(r.score) as avg_rating FROM products p JOIN reviews r ON p.id = r.product_id WHERE r.created_at >= NOW() - INTERVAL 30 DAY GROUP BY p.id HAVING avg_rating > 4.0;"},{"title":"Auditing a legacy database report","prompt":"I inherited this reporting query from a developer who left and I have no idea what it's pulling — can you explain it step by step? SELECT dept, SUM(salary) as total_payroll FROM employees WHERE status = 'active' AND hire_date < '2020-01-01' GROUP BY dept ORDER BY total_payroll DESC LIMIT 10;"},{"title":"Debugging an unexpectedly slow query","prompt":"My DBA gave me this query and said it's causing performance issues, but I need to first understand what it's actually doing before I try to fix it — can you explain it in plain English? SELECT DISTINCT c.customer_id FROM customers c WHERE EXISTS (SELECT 1 FROM orders o WHERE o.customer_id = c.customer_id AND o.total > 1000 AND o.status != 'cancelled');"}],"resultDescription":"A natural language explanation of the SQL query, describing what tables are involved, what data is being selected or manipulated, how joins and filters work, and what the overall result set represents — rendered as readable prose suitable for non-SQL experts.","failureModes":["Malformed or incomplete SQL may produce an inaccurate or partial explanation","Very long or highly nested queries may exceed token limits and return truncated output","Non-standard SQL dialects (e.g. proprietary extensions) may not be explained accurately","Empty or missing message body returns an error","Payment failure via x402 returns a 402 status with no explanation"],"whenToPreferThis":"Use this endpoint when you need a fast, on-demand natural language explanation of any SQL statement — especially useful for developers unfamiliar with a codebase, data analysts reviewing legacy queries, or AI agents that need to surface database logic to non-technical stakeholders. Prefer this over general-purpose LLM calls when you want a cost-controlled, per-query microservice with a fixed interface.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-20T06:40:33.454Z","isFirstParty":false,"canonicalSlug":"sql-query-explainer-534991f4"}