Skip to content

Add lesson: sorting and pagination#14

Merged
exekias merged 2 commits into
mainfrom
lesson/03-sorting-and-pagination
May 28, 2026
Merged

Add lesson: sorting and pagination#14
exekias merged 2 commits into
mainfrom
lesson/03-sorting-and-pagination

Conversation

@exekias
Copy link
Copy Markdown
Member

@exekias exekias commented May 28, 2026

Summary

  • New Module 1 lesson 03-sorting-and-pagination covering ORDER BY tie-breakers, NULLS ordering, DISTINCT / DISTINCT ON, LIMIT/OFFSET, and keyset pagination.
  • Renumbers the existing 03-aggregations to 04-aggregations to make room in the module sequence (matches the global ordering in Course curriculum: beginner → expert lesson roadmap #6).
  • Updates the "Up next" pointer in 02-where-conditions so it leads into this new lesson.

Part of #6.

Test plan

  • npm run lessons:validate
  • npx tsc --noEmit
  • npm run lint
  • Manual: read through the lesson in /lessons/03-sorting-and-pagination/preview

🤖 Generated with Claude Code

Covers ORDER BY (tie-breakers, NULLS ordering), DISTINCT and
DISTINCT ON, LIMIT/OFFSET, and keyset pagination as the production
alternative. Renumbers aggregations to 04 to make room in the
module sequence.

Closes 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 2:52pm

Comment on lines +34 to +40
```sql
SELECT title, published_at
FROM articles
ORDER BY published_at DESC NULLS LAST;
```

The seed has no NULLs in `published_at`, so the syntax is the takeaway here.
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 update the seed.sql so there are some nulls to make this actionable. Switch from sql block to , like the rest

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.

Addressed in 6403394. I updated seed.sql to include NULL values in published_at and switched that section in lesson.mdx from a fenced SQL block to a runnable <Run> query so the NULLS LAST behavior is directly actionable.

@exekias exekias merged commit 6db7a65 into main May 28, 2026
3 checks passed
@exekias exekias deleted the lesson/03-sorting-and-pagination branch May 28, 2026 15:00
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