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!

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


Lax Shah
Lax Shah
546 Points

PLEASE help!

In the library database, how many books are with the genre of "Science Fiction"? Alias the result as scifi_book_count. The books table has the columns id, title, author, genre and first_published. Type in your command below. Get Help Check Work

SELECT COUNT (genre = "Science Fiction") AS scifi_book_count FROM books;

1 Answer

Steven Parker
Steven Parker
225,730 Points

The argument to COUNT should just be 1 or * to count the rows. Testing the genre should be done in a WHERE clause that comes after the FROM clause.

In future questions, please include a link to the course page you are working with to facilitate a complete analysis.