LIMIT Result
Predict Output Beginner
Question
What does this SQL produce?
Code
-- users has 10 rows
SELECT name FROM users LIMIT 3;
Hint
LIMIT 3 returns at most 3 rows.
Explanation
LIMIT 3 restricts the result to at most 3 rows. Even if the table has 10 rows, only 3 are returned. Without ORDER BY, which 3 rows are returned is unspecified.
Related Resources
Related Lessons
- SELECT
Learn SELECT.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.