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.

50
Duration
2s
Input Tokens
1194
Output Tokens
403
Cost
$0.00
Context
Input
I am in the class with teacher Amanda Svensson, I can't find the link to the video for the last lesson. Can you provide me with it?
Expected output
SELECT l.video_url FROM lessons l JOIN courses c ON l.course_id = c.course_id JOIN users u ON c.instructor_id = u.user_id WHERE u.name = 'Amanda Svensson' AND l.order_index = (SELECT MAX(order_index) FROM lessons l2 WHERE l2.course_id = c.course_id);
Model output
SELECT T3.video_url FROM users AS T1 INNER JOIN enrollments AS T2 ON T1.user_id = T2.user_id INNER JOIN lessons AS T3 ON T2.course_id = T3.course_id INNER JOIN courses AS T4 ON T2.course_id = T4.course_id INNER JOIN users AS T5 ON T4.instructor_id = T5.user_id WHERE T5.name = 'Amanda Svensson' AND T1.name = (SELECT name FROM users WHERE user_id = (SELECT user_id FROM enrollments WHERE course_id = T4.course_id LIMIT 1)) ORDER BY T3.order_index DESC LIMIT 1