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

What should I write to retrieve 'Science Fiction' from books?

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

Hi Edward,

Can you link to the challenge and post what query you are trying?

1 Answer

Steven Parker
Steven Parker
231,261 Points

Without seeing what you were trying or a link to your challenge, I can't be specific, but here's some general hints:

  • When retrieving the "earliest" of something, you'll want to ORDER BY the date it was issued, and then LIMIT your output to just 1 row.
  • When looking for things of a particular type, you will use a WHERE clause comparing the column with the type (perhaps genre in this case?) to the desired type ('Science Fiction').

Hopefully that will get you going, or you can post more info.