Skip to content

feat(week-10): add dbt SQL practice exercises#35

Merged
lassebenni merged 1 commit into
mainfrom
feat/data-track-week-10
Jul 2, 2026
Merged

feat(week-10): add dbt SQL practice exercises#35
lassebenni merged 1 commit into
mainfrom
feat/data-track-week-10

Conversation

@lassebenni

Copy link
Copy Markdown
Collaborator

Summary

  • Adds data-track/week-10/ with 4 dbt SQL exercises for Week 10 (dbt Core)
  • Exercises are dbt model/macro/test files students copy into their existing project (same pattern as Week 9's SQL files, adapted for dbt's file types)
  • Each exercise has a starter file with TODO comments, a README with success criteria, and a solutions/ folder with WHY-annotated reference implementations

Exercises

Exercise Skill File(s)
1 safe_divide macro + computed columns in stg_trips macros/safe_divide.sql, models/staging/stg_trips.sql
2 Singular test (FAIL 182 → PASS cycle) tests/assert_fare_amount_non_negative.sql
3 Debug a broken ref() at compile time models/marts/fct_trips.sql (broken version)
4 Propagate a column change from staging to mart models/staging/stg_trips.sql, models/marts/fct_trips.sql

Test plan

  • All starter files contain TODO comments, no pre-satisfied answers
  • All solution files contain -- WHY annotation on non-obvious choices
  • Exercise 2 instructs students to first run the test against unfiltered data (FAIL 182) before restoring the filter (PASS), proving the test actually catches the issue
  • Exercise 3 includes only the broken file; the typo is in a {{ ref() }} call so dbt's compile-time error points directly at it
  • Exercise 4 READMEs explain why +fct_trips is needed vs plain fct_trips

🤖 Generated with Claude Code

Four exercises covering the core dbt skills from Week 10 chapters:
- Exercise 1: safe_divide macro + computed columns in stg_trips
- Exercise 2: singular test for negative fares (FAIL 182 -> PASS cycle)
- Exercise 3: debug a broken ref() at compile time
- Exercise 4: propagate a column change from staging to mart with +select

Each exercise provides starter files to copy into the student's existing
dbt project, with solutions/ containing WHY-annotated reference implementations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lassebenni lassebenni merged commit d199035 into main Jul 2, 2026
1 check passed
@lassebenni lassebenni deleted the feat/data-track-week-10 branch July 2, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant