Databases SQL Basics Finding the Data You Want Filtering by Comparing Values

Shain Jones
Shain Jones
1,187 Points

the code challenge is asking if I "selected results as my table." My code is SELECT * FROM results WHERE away_team<10;

Pretty sure my code is correct, could there be an error in the challenge software?

3 Answers

KRIS NIKOLAISEN
KRIS NIKOLAISEN
54,172 Points

Your WHERE clause is comparing a team name to a number. You should be checking the score.

Instead of checking whether away_team is less than 10, check if away_score is less than 10. away_team is the name of the away team, but is not the score.

Caroline Forslund
Caroline Forslund
Front End Web Development Techdegree Graduate 31,925 Points

Hi Shain, The first half is correct and you're almost there. For the other half of the query you're now searching for away teams with scores below 10. What you want to do to pass the challenge is to select all from the results table (like you do), but then you want to find the home teams with scores bigger than 12.