Learn SQL: LIMIT

A little taster

Rosa is short on time. "I don't need to see everything. Just give me a little taster."

A taster with LIMIT

A table can have thousands of rows. With LIMIT you put a maximum on the number of rows you get back.

LIMIT always comes at the very end of your query. This one shows only 3 customers.

SELECT name, city FROM customers LIMIT 3
Result
namecity
Lotte PeetersGent
Jonas ClaesAntwerpen
Amira El IdrissiBrussel

Try it yourself

Rosa wants a taster. Show the name and the price of 5 products.

Ready for more?

The full lesson has 6 exercises, from easy to challenging, with hints, points and a streak you can build.

Start the lesson