Databases SQL Basics Finding the Data You Want Filtering on More than One Condition

Claire Uzenski
Claire Uzenski
1,026 Points

Need more help with SQL basics, having trouble with more of the equations

It has to do with numbers and more equations

Sean T. Unwin
Sean T. Unwin
Treehouse Moderator 28,638 Points

Can you show us what you have tried or explain what you're having trouble with?

Claire Uzenski
Claire Uzenski
1,026 Points

Its a sports team database that involves home score, away team, away score

Sean T. Unwin
Sean T. Unwin
Treehouse Moderator 28,638 Points

Is it the wording of the Challenge you are having trouble understanding what the goal is?

8 Answers

Sean T. Unwin
MOD
Sean T. Unwin
Treehouse Moderator 28,638 Points

Task 1 is asking to get the away_team named 'Hessle' as well as where they scored, away_score, greater than 18 points.

Claire Uzenski
Claire Uzenski
1,026 Points

I tried typing out what I though was the right equation, but it was wrong

Claire Uzenski
Claire Uzenski
1,026 Points

I'm doing beginning SQL basics, the view challenge button should be here

Sean T. Unwin
Sean T. Unwin
Treehouse Moderator 28,638 Points

I understand what the Challenge is. I don't just want to give you the answer. I want to see what you have tried so we can work through it together.

Claire Uzenski
Claire Uzenski
1,026 Points

I've watched the video many times, I tried to to type how the equation should go, but it's always wrong, I either haven't included everything or There's something wrong with it, it's really frustrating.

Sean T. Unwin
Sean T. Unwin
Treehouse Moderator 28,638 Points

Hence the request to share what you have tried so we don't have to flat out give you the answer. ;-)

Start out with, SELECT * FROM results WHERE , and then use the hints I gave in a previous answer.

Claire Uzenski
Claire Uzenski
1,026 Points

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

Thanks for your help. I've tried many attempts. This is the last one I tried. What do you think ?

Sean T. Unwin
MOD
Sean T. Unwin
Treehouse Moderator 28,638 Points

Thank you for adding your attempt!

You're not too far off, really.

After the SELECT we always say which fields, or columns as they are typically called, we want returned. Using an asterisk (*) we mean to grab every column in the table.

What the Challenge is looking for is:

SELECT * FROM results WHERE away_team = 'Hessle' AND away_score > 18
Claire Uzenski
Claire Uzenski
1,026 Points

Thank you for the help, now I'm trying to figure out the second part of the task and this is what I've got so far SELECT * FROM users WHERE last_name = "Hinkley" OR "Pettit"

Claire Uzenski
Claire Uzenski
1,026 Points

I can't figure out what I'm leaving out or if I'm wording it wrong

Sean T. Unwin
Sean T. Unwin
Treehouse Moderator 28,638 Points

... WHERE last_name = 'Hinkley' OR last_name = 'Pettit'

Try to use single quotes as some database engines, such as Microsoft SQL Server, don't like the use of double quotes for String designation.