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 trialJeremy Settlemyer
4,149 PointsDatabases and null
During the challenge portion the quest is:
Select all movies with the "year" column that hasn't been populated yet.
Assuming that nothing has been populated into year, the year should automatically be set to 'NULL'.
So running the following query should be able to pull all movies that do not have a year that is populated:
select * from movies where year is null;
Am I wrong in my way of thinking.
When run on the challenge produces an error
3 Answers
shezazr
8,275 Pointswell it depends if while creating the table they have defined an absent year as NULL or empty i..e ''
so you could try that i.e. where year = ""
Matthew Batman
30,187 PointsI'm pretty sure this is a technical issue.
See this related thread: https://teamtreehouse.com/forum/mysql-query-doesnt-work-i-cant-realize-the-problem-can-you-help-me
Jeremy Settlemyer
4,149 PointsFigured that was the issue. I know I'm not always right, but in some circumstances I go against the norm.
Ally Rippley
Courses Plus Student 7,539 PointsI just tried " select * from movies where year is null; " (no quotes), maybe try this again, and it should work.
Jeremy Settlemyer
4,149 PointsJeremy Settlemyer
4,149 PointsJust gave that a shot and still no luck maybe the instructor of the database foundation course can bring some light to the issue.
I am 100 percent sure that the select * from movies where year is null; is the correct answer, but I could be wrong. Maybe they didn't create the table???