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 DATABASES

SQL DATABASES

Challenge Task 1 of 2 We're back in the sports team database. There's a results table with the columns id, home_team, home_score, away_team, away_score and played_on . Find all the matches in the results table where "Hessle" was playing away as the away team and their score was above 18 points

My Code:

SELECT * FROM results WHERE home_score AND away_score >= 18;

ERROR: You're missing the greater than operator (>)

7 Answers

Hi,

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

You made two mistakes. 1.Didn't specified away team name(i.e. Hessle) 2.In question it is mentioned that score was above 18 points therefore we need ony use (> ) operator not (>=) operator.

Cool Thank you Great.

Edgar Barrios
PLUS
Edgar Barrios
Courses Plus Student 7,061 Points

OMG took me a long time to came out with the right answer: (Rolling my eyes #now)

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

chase singhofen
chase singhofen
3,811 Points

yes i started to use the * then took it away and was listing the columns 1st then the results table and i spelled Hessle like Hassle. but i did use the AND & WHERE

Hi All;

This is the Right answer.

        Select * FROM results WHERE "away_team" = "Hessle" And "away_score" > 18;

Thanks. Essa Al Housani

SELECT *FROM results WHERE away_score <10;

Hi team,

Please use the following query as your answer to this question:

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