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 trialSergiu Ursachi
947 PointsError bug
I think there is an error. It tells me that the columns are missing and I have added them all. Can't pass to the next steps. Thank you
Sergiu Ursachi
947 PointsChallenge 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" https://teamtreehouse.com/library/sql-basics/finding-the-data-you-want/filtering-by-dates-2
Steven Parker
231,261 PointsSo far so good. Now what did you put in as an answer?
5 Answers
Steven Parker
231,261 PointsYou're almost there. Now, instead of naming the columns explicitly, just use an asterisk (*) to represent "all columns".
Sergiu Ursachi
947 PointsThank you for this suggestions. I will try again right now and rely after. Appreciate your help Steven!
Sergiu Ursachi
947 PointsIt still didn't let me get through. Error: "Bummer! You didn't select all columns." Here is what I wrote:
SELECT id, home_team, home_score, away_team, away_score, played_on FROM results WHERE away_team="Hessle" AND played_on>="2015-10-01";
Sergiu Ursachi
947 PointsThank you!
Steven Parker
231,261 PointsYou're welcome. Remember to choose a "best answer" to indicate the issue is resolved.
Steven Parker
231,261 PointsI can't tell you what went wrong without seeing your code, but I can give you some generic hints:
- In your WHERE clause, you will perform two separate tests and combine them
- Since you want both tests to be true, your combining keyword will be AND
- Dates can be compared like numbers, a later date is greater than (>) an earlier date
- Remember to put quotes around the team name and the specific date you are comparing to
- Be sure to enter the date to compare to using the format given in the challenge
Hopefully, these hints will get you going. Or you can post your code for a specific analysis.
Steven Parker
231,261 PointsSteven Parker
231,261 PointsIf this is for a challenge, provide a link to the challenge and share your code (be sure to blockquote it properly). If you are doing an exercise in workspaces, make a snapshot of your workspace and post the link to it.