skip to content
promptdojo
_
[ save your spot ]
[ follow on x ]
Joins and label windows without leakage — step 2 of 7
ch 36 · sql for ml datasets
2/7
promptdojo
_
›
phase 06 · ml systems
›
ch 36 · sql for ml datasets
lesson 2 of 4 · joins and label windows without leakage
step 2 of 7 in this lesson
Your churn label is measured in March. Which per-user feature query is LEGAL to train on?
1
SUM(actions) WHERE month < '2026-03' — features stop before the label window opens
2
SUM(actions) over all months — more data means a better model
3
SUM(actions) WHERE month = '2026-03' — the freshest data is the most relevant
4
Whichever query scores best on the test set
check
Show hint
ch 36 · sql for ml datasets
2/7
promptdojo
_
›
phase 06 · ml systems
›
ch 36 · sql for ml datasets
lesson 2 of 4 · joins and label windows without leakage
step 2 of 7 in this lesson
Your churn label is measured in March. Which per-user feature query is LEGAL to train on?
1
SUM(actions) WHERE month < '2026-03' — features stop before the label window opens
2
SUM(actions) over all months — more data means a better model
3
SUM(actions) WHERE month = '2026-03' — the freshest data is the most relevant
4
Whichever query scores best on the test set
check
Show hint
park a thought