SQL Generation

Turn plain-English questions into correct SQL against a schema. The skill behind analytics chat, natural-language dashboards, and 'just ask the database' interfaces.

100
Duration
5s
Input Tokens
2
Output Tokens
146
Cost
$0.03
Context
Input
Show the total sales revenue (total_revenue) per branch (branch_name)
Expected output
SELECT d.name AS branch_name, SUM(s.sale_price) AS total_revenue FROM sales s JOIN dealerships d ON s.branch_id = d.branch_id GROUP BY d.name;
Model output
SELECT d.name AS branch_name, SUM(s.sale_price) AS total_revenue FROM sales s JOIN dealerships d ON s.branch_id = d.branch_id GROUP BY d.name ORDER BY total_revenue DESC;