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 trialAry de Oliveira
28,298 PointsSQL 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
akshaythakur
Courses Plus Student 34,019 PointsHi,
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.
Ary de Oliveira
28,298 PointsCool Thank you Great.
Edgar Barrios
Courses Plus Student 7,061 PointsOMG 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
3,811 Pointsyes 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
EISSA ALHOUSANI
Courses Plus Student 643 PointsHi All;
This is the Right answer.
Select * FROM results WHERE "away_team" = "Hessle" And "away_score" > 18;
Thanks. Essa Al Housani
Jamal Shiekh
6,440 PointsSELECT *FROM results WHERE away_score <10;
Krishnanath Maly
Android Development Techdegree Student 6,095 PointsSELECT * FROM results WHERE away_score > 18 AND "Hessle" = away_team;
Luis Barahona
4,529 PointsHi team,
Please use the following query as your answer to this question:
SELECT * FROM results WHERE away_team = "Hessle" AND away_score > 18;