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 Reporting with SQL Ordering, Limiting and Paging Results Limiting Results

What is wrong with my code?

SELECT * FROM books WHERE genre = "Fantasy" ORDER BY year_released ASC LIMIT 5;

Even chatGPT agrees with my solution!

2 Answers

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Hey Jason Chalangary 👋

You'll want to be very careful with assuming that ChatGPT provides you the correct information, and fact check what it says. It's an impressive tool but it has provided me false information countless of times, and it looks like it send you off in the wrong direction this time around as well.

For passing this challenge you'll want to have a good look at the challenge, currently you're ordering by the year_released column, which doesn't exist on the table.

We're using the library database again. There's a books table. There's a title, author, genre and first_published column.

Simply changing the year_released to be first_published will select the right column and pass the challenge as expected.

Hope this helps 🙂

I realised that after I posted! Thanks very much!