main sql-essentials/lessons/04-joins-explained-with-venn-diagrams-sort

README.md

Lesson 4: JOINs explained with Venn diagrams (sort of)

This lesson covers jOINs explained with Venn diagrams (sort of). You'll read a short explanation, try three small exercises and finish with a quiz.

Full lesson: https://glibcode.net/courses/sql-essentials/lessons/4

Files

  • joins.sql: INNER and LEFT JOINs between customers and orders

Tip: Write the FROM and JOIN lines first, then SELECT: it matches how the database reads the query.

Tip: Count before you delete: run the same WHERE with SELECT COUNT(*) first.

Tip: .mode box and .headers on in sqlite3 make results much easier to read.

Run it

sqlite3 shop.db < ../../setup/schema.sql
sqlite3 shop.db < ../../setup/seed.sql
sqlite3 shop.db < joins.sql

Exercises

See exercises.md. Ask in the forum once you've tried.