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 Filtering on More than One Condition

kimberly moyer
kimberly moyer
1,773 Points

unsure on error

hi i need help correcting the sql statement

Can you post your SQL statement?

1 Answer

For the first challenge we need to do the following:

Find all the matches in the results table where "Hessle" was playing away as the away team and their score was above 18 points.

I emphasized the keywords in the sentence that will help determine what is necessary:

SELECT * FROM results
WHERE away_team = "Hessle"
AND away_score > 18;

For the second challenge we need to:

Find all users with either the last name "Hinkley" or "Pettit".

We can get the users with a last_name of "Hinkley" or "Pettit" in a few ways:

SELECT * FROM users
WHERE last_name = "Hinkley"
OR last_name = "Pettit";

or

SELECT * FROM users
WHERE last_name IN ("Hinkley", "Pettit");

This one will return users whose last name is in the provided list of names.

I think U shuld not give full answer already.. Learning means trying....