Honest Take — Before You Begin
You have written ActiveRecord queries for nine years. You know .where, .joins, .group, .having. You can chain scopes in your sleep. But I would bet real money you cannot write a W…
Build rock-solid SQL fundamentals beyond what ActiveRecord generates. Understand the relational model — sets, relations, normalization — so you can reason about database design from first principles instead of from Rails conventions. ActiveRecord generates SQL. Reading EXPLAIN ANALYZE output is the single most valuable database skill for a Rails engineer. When you write `User.where(active: true).order(:created_at).limit(10)`, ActiveRecord generates `SELECT "users".* FROM "users" WHERE "users"."active" = TRUE ORDER BY "users"."created_at" ASC LIMIT 10`. But what plan does PostgreSQL choose? Index scan or sequential scan? Does the index on `active` help or does the `ORDER BY` force a sort? After Module 0, you can answer these questions by reading the query plan, not by guessing.
You have written ActiveRecord queries for nine years. You know .where, .joins, .group, .having. You can chain scopes in your sleep. But I would bet real money you cannot write a W…
Approach: YOUR BOOK
Approach: YOUR BOOK
Approach: YOUR BOOK
Work through each item before the checkpoint.
Write 20 raw SQL queries against a real PostgreSQL database (use your Rails app's development database): 1. Multi-table JOINs (INNER, LEFT, FULL OUTER) 2. Subqueries (correlated a…
6 lessons. Read in order; spiral back when you need to. By the end you'll have used the core ideas twice — once on the abstract, once on something you'll meet at work next week.