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
35s
Input Tokens
942
Output Tokens
91
Cost
$0.00
Context
Input
Please delete any lessons that are still in draft and were created before 2022.
Expected output
DELETE FROM lessons WHERE is_draft = TRUE AND lesson_id IN (SELECT l.lesson_id FROM lessons l JOIN courses c ON l.course_id = c.course_id WHERE c.created_at < DATE '2022-01-01');
Model output
DELETE FROM lessons l USING courses c WHERE l.course_id = c.course_id AND l.is_draft = TRUE AND c.created_at < '2022-01-01';