Skip to content

Add lesson: advanced joins#18

Merged
exekias merged 3 commits into
mainfrom
lesson/10-advanced-joins
May 28, 2026
Merged

Add lesson: advanced joins#18
exekias merged 3 commits into
mainfrom
lesson/10-advanced-joins

Conversation

@exekias
Copy link
Copy Markdown
Member

@exekias exekias commented May 28, 2026

Summary

  • New Module 3 lesson 10-advanced-joins (module-relative 02-advanced-joins).
  • Covers RIGHT JOIN (and why LEFT is usually preferred), FULL OUTER JOIN for reconciliation, CROSS JOIN for Cartesian products, the self-join pattern using a manager_id self-reference, and multi-table chains. Closes with a "when to use which" decision table.
  • Updates 01-joins's "Up next" pointer to lead into this lesson.

Part of #6.

Test plan

  • npm run lessons:validate
  • npx tsc --noEmit
  • npm run lint
  • Manual: walk through the lesson in /lessons/10-advanced-joins/preview — confirm the FULL JOIN surfaces both Operations (no employees) and the two contractors (no department), and that the self-join lists each employee alongside their manager

🤖 Generated with Claude Code

Covers RIGHT JOIN (and why LEFT is usually preferred), FULL OUTER
JOIN for reconciliation, CROSS JOIN for Cartesian products, the
self-join pattern for in-table hierarchies (employees/manager_id),
and multi-table chains. Closes with a "when to use which" decision
table.

Also updates 01-joins's "Up next" pointer to lead into this lesson.

Part of #6.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
learn-postgres Ready Ready Preview May 28, 2026 4:06pm

Comment on lines +102 to +112
A useful mental table:

| You want… | Use |
| ------------------------------------------------------------ | -------------- |
| Rows that match on both sides | `INNER JOIN` |
| All rows from the left, matches from the right where present | `LEFT JOIN` |
| Same, but with the tables in the other order | `RIGHT JOIN` |
| All rows from both sides, NULLs where they don't match | `FULL JOIN` |
| Every combination of left × right | `CROSS JOIN` |
| A row's relationship to other rows in the same table | self-join |

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot this table didn't render correctly, fix it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the latest commit. remark-gfm isn't installed, so GFM pipe tables don't render in MDX. Replaced the markdown table with a plain HTML <table> — MDX handles it natively and @tailwindcss/typography's prose class takes care of styling.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot I would rather go for remark-gfm approach if that's not too complex

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — installed remark-gfm and added it to MDXRemote's remarkPlugins in page.tsx. The GFM pipe table in the lesson is restored as-is.

@exekias exekias merged commit a28a3e0 into main May 28, 2026
2 checks passed
@exekias exekias deleted the lesson/10-advanced-joins branch May 28, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants