SQL Learning Outcomes

What the industry expects

Use AI copilots

  • Engineers move 10x faster with GPT and Claude.
  • But firms pay for judgment, not just output.
  • They need engineers who can check AI output and fix the logic that is wrong.

Semantic interviews

  • 50% of data interview questions are SQL logic.
  • Whiteboard rounds have no AI: you write and reason about the query yourself.
  • "Debug this query": right or wrong? Expensive or cheap? How to fix it?

Cloud-scale reality

  • BigQuery, Snowflake, and Redshift are everywhere.
  • Parallel execution across many machines.
  • Cut cost with partitioning and filter placement.

What you'll do in CS145

Use your brain

  • Write SQL logic on paper or a whiteboard, no IDE.
  • Use debug tables to trace semantics.

Prep for whiteboard interviews: ace Test 1 on paper (SQL is half the exam).

Example anecdote 1

  • Project 1: a NULL-values problem. Mismatches across COUNT(rating), COUNT(*), and COUNT(user_id).
  • On the Project 1 dataset (far larger than the 9-row Spotify table): 50 NULL ratings. COUNT(column) skips NULLs; COUNT(*) counts all rows.

Experiment with LLMs

  • Explore subqueries, window functions, and analysis.
  • Project 1: find what works, and learn when AI misleads.

Prep for interviews: "What is your AI workflow for data pipelines?"

Example anecdote 2

  • Project 2: Claude built my 3-level CTE in seconds. But level 2 referenced level 3, which did not exist yet, and its LEFT JOIN with COUNT(*) counted NULLs.
  • Fixed: reordered the CTEs, used COUNT(t2.id).
  • Saved 30 min writing, spent 10 min debugging.

Cloud databases

  • Query gigabytes of data on BigQuery.
  • Understand parallel execution.
  • Tune production queries for cost and speed.

Prep for interviews: build a data portfolio on BigQuery and Colab.

Example anecdote 3

  • Project 1: a query kept timing out at $10.50 per run.
  • The execution plan scanned 2.1 TB before filtering. Moving the date filter before the JOIN triggered partition pruning.
  • Now 73 GB, $0.37, 12 seconds, and a Colab to prove it.

Project 1: practice all three skills

  • Build your BigQuery portfolio while mastering brain, AI, and cloud skills.
  • You query real datasets and keep the notebooks as portfolio work.

Why these topics?

You will use these skills in internships, interviews, and full-time work.