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 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.

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