Jacques: apart from being able to add a where after the joins, you might be interested to know that the “ON” in the join clause is essentially a where, too. So you can also say “LEFT JOIN foo ON bar.bar_id = foo.bar_id AND active = true”;

Lorna; although I agree that in some cases, adding an alias to a query is a good idea, I disagree in this instance. I personally find “categories.name” much easier to read than “c.name”. As SQL queries are generally write-once, read many, I think being verbose is actually helpful. In the rest; very good article! I wish I’d run into such an article years ago ;)