Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

Michael Lawinger
Michael Lawinger
33,581 Points

Database Results

I'm not sure what I'm doing wrong, this is the question: Get the 11th to 30th movie from the movies table. Be sure to return every column. Also, there's no need to order the results.

3 Answers

You'll need to use a select statement with a limit of 20 and an offset of 10. The offset will set your results to start from the 11th row in the resultset and the limit of 20 will show the results up to 30.

So, your query should be something like SELECT * FROM table LIMIT 20 OFFSET 10

Bogdan Cabaj
Bogdan Cabaj
16,349 Points

select * from movies limit 20 offset 10

10 means we are starting from 11 and limit will give us 20 rows back

Michael Lawinger
Michael Lawinger
33,581 Points

Thanks guys, It's my first time learning database and I was understanding it pretty well up until this point but it's getting intense.