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
6s
Input Tokens
980
Output Tokens
107
Cost
$0.00
Context
Input
List the names of employees and how many vehicles each of them has sold, including employees with 0 sales.
Expected output
SELECT e.name, COUNT(s.sale_id) AS vehicles_sold FROM employees e LEFT JOIN sales s ON e.employee_id = s.employee_id GROUP BY e.name ORDER BY e.name;
Model output
SELECT e.name, COUNT(s.sale_id) as vehicles_sold FROM employees e LEFT JOIN sales s ON e.employee_id = s.employee_id GROUP BY e.employee_id, e.name ORDER BY e.name;