Applications of Large Language Models to SQL Learning
TL;DR Highlight
An o4-mini multi-step pipeline generates SQL answers and grades work close to human graders.
Who Should Read
A developer on an education or data team who spends too much time writing and grading SQL exercises and wants to automate it with LLMs
Core Mechanics
- One workflow covers problem creation to grading
- It generates industry-style practice problems from real data-wrangling scenarios.
- Each problem gets pedagogical metadata.
- Reference SQL generation and submission grading run in the same agentic workflow.
- Reference SQL is built in several steps
- A multi-step pipeline plans the SQL operator by operator.
- It runs zero-shot with o4-mini, with no training.
- It beats a single prompt clearly
- It substantially outperforms a single-prompt baseline.
- It approaches state-of-the-art pipelines trained with supervised learning.
- Grading uses rubrics and explains itself
- Submissions are graded against detailed rubrics.
- It explains partial credit and gives feedback for revision.
- It held up in a real classroom
- The test covered 4 exam questions and 326 submissions with 6 human graders.
- LLM grading signals were competitive with human graders for many question types.
Evidence
- Reference generation beat a single prompt by a wide margin
- On a large corpus of realistic SQL problems, the zero-shot multi-step o4-mini generator substantially outperformed a single-prompt baseline.
- The abstract gives no exact numbers.
- It approached supervised SOTA pipelines
- It came close to state-of-the-art pipelines trained with supervised learning.
- No exact numbers are given in the abstract.
- Classroom grading study size
- 326 submissions across 4 exam questions were graded by 6 graders and compared with LLM grading.
- LLM grading was competitive with humans for many question types.
How to Apply
- Try your rubric in a grading prompt
- Pick one SQL assignment and a few submissions and grade them with the prompt below.
- Compare against human scores and look at where they disagree.
- Split reference SQL generation into steps
- Have the model plan the needed operators (JOIN, filter, aggregation) before writing SQL.
- Run the generated SQL and check the result.
- Attach metadata to generated problems
- Ask the model to output difficulty and the concepts covered with each problem.
- Use it for problem-bank search and personalized practice.
- Show students why they lost points
- Output the deduction reason and a revision hint with each grade.
- Have a human review only the disagreement cases.
Try It
# Paste into Claude or ChatGPT (simplified version of the paper's method)
너는 SQL 수업의 채점 보조자다.
[문제]
{{문제}}
[스키마]
{{테이블 스키마}}
[루브릭]
{{항목별 배점 기준}}
[학생 제출 SQL]
{{학생 SQL}}
절차:
1. 문제 해결에 필요한 연산자(JOIN, WHERE, GROUP BY 등)를 단계별로 계획해 정답 SQL을 작성한다.
2. 루브릭 항목별로 학생 SQL을 채점한다.
3. 부분 점수를 준 항목은 이유를 설명한다.
4. 학생이 수정할 수 있도록 구체적인 피드백을 3줄 이내로 쓴다.
출력은 JSON: {"reference_sql": "", "scores": [{"item": "", "score": 0, "reason": ""}], "total": 0, "feedback": ""}Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques
Original Abstract (Expand)
We present a Large Language Model (LLM)-assisted SQL learning system that closes the loop from problem discovery to grading. Grounded in real-world data-wrangling scenarios, our agentic workflow (i) synthesizes industry-style practice problems with pedagogical metadata, (ii) produces executable reference SQL via a multi-step operator-planning pipeline, and (iii) grades student submissions against rich rubrics while explaining partial credit and surfacing actionable feedback for revision. We evaluate two core capabilities. First, on a large corpus of realistic SQL problems, our zero-shot, multi-step reference-answer generator, implemented with OpenAI's o4-mini, substantially outperforms a single-prompt baseline while approaching the state-of-the-art pipelines trained with supervised learning. Second, in a classroom deployment, we compare LLM-assisted grading with human graders across four exam questions, encompassing 326 submissions evaluated by six graders. The results indicate that LLMs can provide grading signals competitive with those of human graders for many question types. Overall, the system is designed for responsible educational use through real-world problems, generated reference solutions, and grading assistance. Together, these features enable scalable practice generation and grading, which improves student learning while augmenting instructor capacity.