r/SQL • • 3d ago

BigQuery BigQuery lessons

There are plenty of good free courses for general SQL, on Postgres, MySQL, SQLite and so on. But I couldn't find one dedicated to BigQuery that works without a BigQuery account. Most of them start with creating a Google Cloud project, or with the sandbox.

We build a BigQuery IDE, Querylab.io, and it turned out it already had what that needs:

  • Its own SQL engine that runs in your browser. That's why they're free, and you don't need to sign up or install anything.
  • Completions and error checks as you type, so you see a typo before you run the query.
  • Every query shows what it would cost on BigQuery. You can ignore it at first, but on a real database a careless query costs money, and it's good to learn that early.

So we built 76 short lessons on top of it. Each one explains one idea with an example, then gives you a few challenges, and the site checks your answer. Some ask you to fix a broken query or to guess the result before you run it.

Most of the practice data is a sample of real UK MOT data. MOT is the yearly inspection every car in the UK over three years old has to pass, and the data is how each car did. Cool dataset btw. There's also a made-up online shop and some website analytics events.

The SQL is BigQuery's. For the basics it's very close to what you'd write anywhere else. There are three levels:

  • SQL from zero: SELECT, GROUP BY, joins, dates, CTEs, window functions (35 lessons)
  • What BigQuery does its own way: cost, partitions, arrays and structs, pipe syntax, scripting (29 lessons)
  • Analytics on Google Analytics 4 data: sessions, funnels, retention (9 lessons)

It works best on a computer.

https://learn.querylab.io/lesson/select-where/

If a lesson confuses you, tell me which one and where you got stuck. I'd love any feedback, and we'll fix it.

8 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/querylabio 1d ago

You're right, the lesson made it sound like any WHERE saves money. Only the date filter really does here, since the table is partitioned by month. It's also clustered by vehicle_id, test_result and make, but vehicle_id comes first, so filtering on make or result skips very little. Mostly it just gives you fewer rows back. Reworded the lesson to say that.

Thanks. Appreciate the feedback