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


Write a query to bring the 2nd page of result.

link for the above question: https://teamtreehouse.com/library/reporting-with-sql/ordering-limiting-and-paging-results/paging-through-results-2

2 bummers I got as below, when I got 10 returns, the bummer was retrieving 'Science Fiction'. When I added genre = 'Science Fiction', I got 10 books were expected. The inquiry was order by title and limit 10 offset 2. Thanks

select * from books order by title limit 10 offset 2;

id title author genre first_published 20 Animal Farm George Orwell 1945 13 Armada Ernest Cline Science Fiction 2015 19 Contact Carl Sagan Science Fiction 1985 17 Dune Frank Herbert Science Fiction 1965 15 Emma Jane Austen Classic 1815 10 Frankenstein Mary Shelley Horror 1818 2 Harry Potter and the Chamber of Secrets J.K. Rowling Fantasy 1998 7 Harry Potter and the Deathly Hallows J.K. Rowling Fantasy 2007 4 Harry Potter and the Goblet of Fire J.K. Rowling Fantasy 2000 6 Harry Potter and the Half-Blood Prince J.K. Rowling Fantasy 2005

Bummer! Your query needs to retrive the earliest 'Science Fiction' book from the books table.

select * from books where genre = 'Science Fiction' order by title limit 10 offset 2;

id title author genre first_published 17 Dune Frank Herbert Science Fiction 1965 12 Ready Player One Ernest Cline Science Fiction 2011 18 The Circle Dave Eggers Science Fiction 2013 11 The Martian Andy Weir Science Fiction 2014

Bummer! Ten books were expected. 4 were returned in the results.

1 Answer

Steven Parker
Steven Parker
229,968 Points

For the first task, the challenge asks you to return the second page of results. Since there's 10 on a page, you'd need OFFSET 10 instead of OFFSET 2.

select * from books order by title limit 10 offset 10;

Some of the feedback messages you were getting seem misleading. You might want to report this as a bug to Treehouse Support.