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

How to you select the fantasy genre?

I am trying to select just the fantasy section of the genre column but am confused as to how to do it (it is in the middle of the alphabet so there is no clear way to pull it out that I know of)!

2 Answers

Steven Parker
Steven Parker
229,005 Points

Without a link to the challenge, I can only guess, but it sounds like your query would need to include a clause like this:

WHERE genre = 'Fantasy'

If there are no other objectives, the query might look like this:

SELECT * FROM table_name WHERE genre = 'Fantasy';

Of course, you have to substitue table_name with the actual name of the table.

Allie O.
Allie O.
11,601 Points

Hi Dan,

I can't see the challenge you're working on, but maybe instead of thinking it as getting a section of the column, if you think of it as getting the values WHERE genre equals fantasy, it might help you figure it out :)