LLM tooling · cheat sheet
Text-to-SQL is only as good as the description it reads. Fill in the template, then run the three test questions yourself and compare with what the model writes before anyone else uses it.
TemplateThe data description, filled in for the season game log.
Table game_log: one row per game of one team's 162-game season.
- game: integer, 1 to 162, the order games were played.
- home: 1 for a home game, 0 away.
- runs_scored, runs_allowed: runs in that game.
- weekend: 1 for a Friday, Saturday or Sunday game.
- attendance: paid attendance; 0 on away games (not missing).
Rules: a win is runs_scored > runs_allowed. Attendance questions use home games only.SQLThe three test questions, run against the data with sqlite3.
-- 1. How many home games did the team win?
SELECT COUNT(*) AS home_wins FROM game_log WHERE home = 1 AND runs_scored > runs_allowed;
-- 2. Average attendance, weekend against weekday (home games only)
SELECT weekend, ROUND(AVG(attendance)) AS avg_attendance FROM game_log WHERE home = 1 GROUP BY weekend;
-- 3. The longest winning streak
WITH g AS (SELECT game, runs_scored > runs_allowed AS win,
game - ROW_NUMBER() OVER (PARTITION BY runs_scored > runs_allowed ORDER BY game) AS grp
FROM game_log)
SELECT MAX(n) AS longest_win_streak FROM (SELECT COUNT(*) AS n FROM g WHERE win = 1 GROUP BY grp);Ran when this sheet was built. Output:
home_wins
45
weekend avg_attendance
0 29450.0
1 35061.0
longest_win_streak
7Loading the calendar.
The calendar did not load here. Open it on Calendly.
Confirmed
Calendly has sent the invitation to your inbox, with the link for the call. Michael will see you then.
We've teamed up with AthlyticZ to supercharge how we use data science and statistics to impact our sports. More clarity in the numbers means bigger results for our athletes.
AthlyticZ has completely transformed the learning approach to data science through the use of sports-based problems. The instructors are the best of the best, and the practical projects have immediate impact to students.
The sports industry moves fast. Managing the pace of evolving technology, data, and AI isn't optional - it's imperative. Our Analytics team was looking for a partner to meet us where we are, to help us in the continued investment of our people and capabilities without pulling us away from the work that matters. AthlyticZ delivers exactly that: a structured, practitioner-led platform that fits how modern sports analytics groups actually operate.