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

CANT FIGURE OUT

In the e-commerce database we have a products table. The columns are id, name, description and price. Find all the products where the pattern 't-shirt' can be found anywhere in the product name.

You'll want to use a wildcard in conjunction with the LIKE operator and value you're searching for in your where clause. I am not looking at the exact problem you are referencing but your solution should look something like this:

select * from products where name LIKE '%t-shirt%'

The percent sign is your wildcard. I would recommend prepending and appending 't-shirt' with both, as you are required to look for the pattern "anywhere" within the field. Using the wildcard in this manner will ensure that you check all possibilities of this pattern.

Here is more information on Wildcards and the LIKE operator:

Steven Parker
Steven Parker
231,140 Points

In future, be sure to show your code, and provide a link to the course page you are working with.