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

Development Tools

Databases 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

well 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 = ""

Just 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???

Figured that was the issue. I know I'm not always right, but in some circumstances I go against the norm.

I just tried " select * from movies where year is null; " (no quotes), maybe try this again, and it should work.