SQL

Natural language to SQL query generation evaluates text-to-query fidelity and schema reasoning. This task is particularly relevant for analytics chat assistants and simplified database interfaces where users need to query data using natural language. Models must understand both the intent behind the question and the structure of the underlying database schema.

100
Duration
4s
Input Tokens
988
Output Tokens
473
Cost
$0.00
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 T2.name AS branch_name, SUM(T1.sale_price) AS total_revenue FROM sales AS T1 INNER JOIN dealerships AS T2 ON T1.branch_id = T2.branch_id GROUP BY T2.name