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 trialJesus Franco
9,236 PointsCANT 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.
Steven Parker
231,271 PointsIn future, be sure to show your code, and provide a link to the course page you are working with.
Ben Farr
3,834 PointsBen Farr
3,834 PointsYou'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: