How can we return only the top N records from a sorted dataset?
LIMIT constrains the number of rows returned by a query, ideal when paired with ORDER BY.
Pagination, top 10 rankings, sampling large tables, and quick exploratory analysis.
SELECT *
FROM employees
ORDER BY salary DESC
LIMIT 10;Practice typing production-grade SQL code for Sorting & Limiting Results.