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 SQL Basics Finding the Data You Want Review & Practice with SQL Playgrounds

Find all actors whos first name starts with Will - not sure how to do this one

Will of the Actors: Find all actors whos first name starts with Will

In table actors, there's only two columns, id and name. My code below pulls up an actor with last name Will, not first name Will. I am not sure how to find the data with first name Will in this table because the first and last names are not segregated. Can anyone help?

My code that doesn't work:

SELECT * FROM actors WHERE name LIKE "%Will";

3 Answers

oliver burton
oliver burton
3,342 Points

The wild card should be put where the text is missing. "%Will" represents any number of characters and then "Will." If you want Will to be the first name first name, you should put the wildcard after Will like this: "Will%"

Hope this helps

The right answer is here:

SELECT * FROM actors WHERE name LIKE "Will%";

As Oliver Burton said before,we are looking for 1st name to be Will. % is put after Will,meaning we don't know the 2nd name.

JASON LEE
JASON LEE
13,655 Points

Also note that "Will%" does not return the same result as "Will %"