Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Databases Reporting with SQL Ordering, Limiting and Paging Results Limiting Results

Nelson Hinman Jr
Nelson Hinman Jr
6,131 Points

Problem with SQL Reporting Task #2 - finding the oldest Science Fiction book

I can't seem to get this to work. I am not sure if Science Fiction is a book title or a genre - or if I have something wrong.

SELECT * FROM books WHERE title LIKE "%Science Fiction%" ORDER BY first_published ASC LIMIT 1;

2 Answers

Steven Parker
Steven Parker
218,487 Points

You're really close, but it's not the title that should be compared to "Science Fiction", it's the genre.

Next time, if you're not sure, just try it both ways!

Steven Parker
Steven Parker
218,487 Points

Nelson Hinman Jr — Glad to help. You can mark a question solved by choosing a "best answer".
And happy coding!

Nelson Hinman Jr
Nelson Hinman Jr
6,131 Points

All right, thanks for setting me straight.