Select and filter
Project columns, filter rows and sort results predictably.
What you will be able to do
- Prefer explicit columns over SELECT *.
- Use IS NULL, not = NULL.
- Use LIMIT with ORDER BY for pagination.
- Add a unique tie-breaker to stable sorts.
In plain English
SELECT chooses columns, WHERE filters rows before grouping and ORDER BY sorts the result. Use explicit columns in application queries and always add a unique tie-breaker when paginating.
SELECT title, minutes
FROM lessons
WHERE minutes >= 15 AND course_slug = 'css'
ORDER BY minutes DESC, title ASC
LIMIT 20 OFFSET 0;Your turn
EasyFilter and sort
Select the title and minutes of lessons longer than 20 minutes, longest first.
SQL · starter
SELECT title, minutes FROM lessonsCheck your understanding before moving on.
Knowledge checkQuestion 1
Which clause filters individual rows?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.