Duration
22s
Input Tokens
979
Output Tokens
1333
Cost
$0.00
Context
Input
Which students joined this year and already finished a lesson?
Expected output
SELECT DISTINCT u.name FROM users u JOIN completions c ON u.user_id = c.user_id WHERE u.role = 'student' AND u.created_at >= DATE_TRUNC('year', CURRENT_DATE);
Model output
SELECT u.*
FROM users u
JOIN completions c ON u.user_id = c.user_id
WHERE u.role = 'student'
AND u.created_at >= '2023-01-01'::date
AND u.created_at < '2024-01-01'::date;