Welcome to the Treehouse Community
Looking to learn something new?
Leslie Perez993 Points
Don't understand why I get an error
Not sure what is wrong with my code. SELECT COUNT(*) FROM books WHERE genre = "Science Fiction" AS scifi_book_count;
Emmanuel C10,635 Points
This one was a bit tricky, but its not asking to count all the rows, its only asking for the genre. Also the alias should be declared right after the column names. I queried this and it worked.
SELECT COUNT(genre) as scifi_book_count FROM books WHERE genre = 'Science Fiction' ;
Itll be the same with the second task. Just a different column.