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

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
216,136 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 :)