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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
Miguel Nunez
3,266 PointsTwo wild cards vs One in SQL?
I'm very confuse I started doing the code challenges and I started to realize that the teacher was demonstrating the LIKE keyword with one wild card and later in that video he started to use two wild cards with the LIKE operator which I said to my self it doesn't make a difference so I started to do a code challenge next and then I notice one code challenge accepted my one wild card as correct example (SELECT * FROM users WHERE first_name LIKE "L%";) but the next one came along and then I used one wild card again example (SELECT * FROM products WHERE name LIKE "%t-shirt%";)but It said it was wrong so I put two wild cards example and then I passed the code challenge what is the difference between putting one wild card vs two wild cards?
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsGood explanation, Benjamin Larson — you should move your comment to an answer.
Miguel Nunez
3,266 PointsThanks man that helps alot now I have another question I'm taking a quiz and its asking a confusing question. If I wanted to return rows that match either conditions, which keyword would I use? SELECT <columns> FROM <table> WHERE <condition 1> <condition 2>;
1 Answer
![Benjamin Larson](https://uploads.teamtreehouse.com/production/profile-photos/3914252/micro_IMG_20160608_083427.jpg)
Benjamin Larson
34,055 PointsMOVED TO ANSWERS (Steven Parker : not the first time I've made that mistake haha)
Hi Miguel,
Putting a wildcard before (WHERE name LIKE "%t-shirt") means that anything can occur before "t-shirt" is found in a string, but there can't be anything after it.
Conversely, putting the wildcard after (WHERE name LIKE "t-shirt%") means that anything can occur after that value is found, but "t-shirt" must come first in the string.
A wildcard before and after (WHERE name LIKE "%t-shirt%") means that anything can come before OR after. It should be noted that it's not a requirement for something to come before or after, meaning that "t-shirt" alone would satisfy the requirements.
To answer your second question: It sounds like the quiz is asking for the "OR" keyword in between the WHERE conditions.
Benjamin Larson
34,055 PointsBenjamin Larson
34,055 PointsHi Miguel,
Putting a wildcard before (WHERE name LIKE "%t-shirt") means that anything can occur before "t-shirt" is found in a string, but there can't be anything after it.
Conversely, putting the wildcard after (WHERE name LIKE "t-shirt%") means that anything can occur after that value is found, but "t-shirt" must come first in the string.
A wildcard before and after (WHERE name LIKE "%t-shirt%") means that anything can come before OR after. It should be noted that it's not a requirement for something to come before or after, meaning that "t-shirt" alone would satisfy the requirements.