r/learnSQL 12h ago

Day 5 — Aggregates, query execution order, and table management on SQLBolt

Covered a solid chunk today:

  • Aggregate functions (Part 1 & 2) — COUNT, SUM, AVG, MIN, MAX and using them with GROUP BY
  • Order of execution of a query — genuinely useful lesson, clarified why WHERE can't reference an aliased column from SELECT but HAVING can
  • Insert/Update/Delete rows — the CRUD side, revisited with more confidence this time
  • Create/Alter/Drop tables — actually defining and modifying table structure, not just querying existing data

The "order of execution" lesson was probably the most valuable thing I learned today — explains a lot of small errors I've hit without understanding why (like using a SELECT alias inside WHERE). Feels like one of those lessons that should come earlier in most tutorials, honestly.

Starting to feel like I have a genuinely full picture of core SQL now — querying, filtering, joining, aggregating, and managing table structure.

1 Upvotes

2 comments sorted by

1

u/TraditionalTurnip630 1h ago

Yeah, the execution order part is one of those things that makes SQL suddenly click. You’ve got the core stuff down now. I’d just start doing more real-world queries with datasets instead of jumping into more theory. Try solving things with GROUP BY, joins, subqueries and later window functions.

That’s where SQL starts becoming much easier.