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

marika devan
marika devan
4,780 Points

Select all movies that have data in the "year" column.

This is my code. What a I doing wrong?

SELECT*FROM movies WHERE year IS NOT NULL ORDER BY year;

4 Answers

Mischa Yartsev
Mischa Yartsev
20,562 Points

Hi marika, For my opinion your doing absolutely right, and when I completed that challenge I did the same. But the challenge builders thought differently ;) In this challenge you only need to query year IS NOT NULL without ordering it by year, like this:

SELECT * FROM movies WHERE year IS NOT NULL;

SELECT * FROM movies WHERE year IS NOT NULL; this should work.

DATABASE FOUNDATIONS.

Challenge Task 1 of 2

Select all movies with the "year" column that hasn't been populated yet. Type in your command below, then press Enter.

SELECT * FROM movies WHERE year IS NULL;

Challenge Task 2 of 2

Select all movies that have data in the "year" column. Type in your command below, then press Enter.

SELECT * FROM movies WHERE year IS NOT NULL;

DATABASE FOUNDATIONS.

Challenge Task 1 of 2

Select all movies with the "year" column that hasn't been populated yet. Type in your command below, then press Enter.

SELECT * FROM movies WHERE year IS NULL;

Challenge Task 2 of 2

Select all movies that have data in the "year" column. Type in your command below, then press Enter.

SELECT * FROM movies WHERE year IS NOT NULL;