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 BASIC

Challenge Task 1 of 1 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 if they played on or after October 1st 2015. Date format is "YYYY-MM-DD".

9 Answers

Maximiliane Quel
PLUS
Maximiliane Quel
Courses Plus Student 55,489 Points

Hi,

there are a few issues with your statement after the SELECT clause. You mixed up the order of the WHERE keyword and your first condition. after WHERE you need to define that you want to filter only for results where the away_team is equal to "Hessel". Then you need the AND keyword to add your second condition that you only want games after the 1st October 2015. It should look like this:

SELECT *
FROM results
WHERE away_team = "Hessel"
AND played_on > "2015-10-01";
Maximiliane Quel
Maximiliane Quel
Courses Plus Student 55,489 Points

Yes we overlooked that it says on or after so instead of > it has to say >=

SELECT *
FROM results 
WHERE away_team = "Hessel"
AND played_on >= "2015-10-01";

SQL DATABASE

Challenge Task 1 of 1 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 if they played on or after October 1st 2015. Date format is "YYYY-MM-DD".

SELECT * FROM results WHERE away_team = "Hessel" AND played_on >= "2015-10-01"; Ernest Thornhill

SELECT * FROM results WHERE away_team = "Hessle" AND played_on >= "2015-10-01";

Solved but yet unresolved,

Without sufficient explanations, why not worked before and now worked in the same conditions,

Nice work! Ary, Great job brushing up on your skills. Practice makes perfect! Keep going

this work for me

SELECT * FROM results WHERE away_team = "Hessle" AND played_on >= "2015-10-01";

HIDAYATULLAH ARGHANDABI
HIDAYATULLAH ARGHANDABI
21,058 Points

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

SELECT * FROM results WHERE away_team >= "Hessle" AND played_on >= "2015-10-01";

SELECT * FROM results WHERE "Hessle" = away_team AND played_on >= "2015-10-01";

SELECT * FROM results WHERE away_team = "Hessle" AND played_on < "2015-10-01";

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 if they played on or after October 1st 2015. Date format is "YYYY-MM-DD". The correct answer to the challenge is: SELECT * FROM results WHERE away_team = "Hessle" AND played_on >= "2015-10-01";

HIDAYATULLAH ARGHANDABI
HIDAYATULLAH ARGHANDABI
21,058 Points

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

chase singhofen
chase singhofen
3,811 Points

i was using the OR keyword b/c it says or in the question. i also didnt use the = "hassel" after the away_team. keep forgetting that syntax