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

PHP

Really need help with task 3 of 3

Note: We will be writing ONLY the SQL query for this challenge. The Media table also contains a category column. Add another condition to the WHERE clause so that only the "Books" category is selected. You may start with the following code from the last task:

2 Answers

M W
M W
3,446 Points

Is this it?

SELECT title FROM Media JOIN Media_People ON Media.media_id = Media_People.media_id JOIN People ON Media_People.people_id = People.people_id WHERE fullname LIKE '%Tolkien' AND category = "Books";

yes, yes it is

Joey Ward
PLUS
Joey Ward
Courses Plus Student 24,778 Points

I'm not sure what the code from the last task looked like. But just addressing what is asked for in this task - We want to filter the category to only match 'Book'. So we would write the code like this:

SELECT * FROM Media WHERE category = "Books"