Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Databases SQL Basics Finding the Data You Want Review & Practice with SQL Playgrounds

Alex Moon
Alex Moon
1,888 Points

Picking all the data that is null

Find all movies with any missing data.

I put SELECT * FROM movies WHERE id OR genre OR year_released OR title IS NOT NULL; but I get data that doesn't necessarily has NULL values as well.

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Alex Moon! According to the code that you posted above you're picking thing where the title is NOT NULL. You'll want to pick things where something IS NULL :smiley:

Also, you will need to specify each thing that could potentially be NULL. Here was my solution:

SELECT * FROM movies WHERE title IS NULL OR year_released IS NULL OR genre IS NULL;

Hope this helps! :sparkles:

Jennifer Nordell you are a lifesaver! Thanks!

Tashan Duncan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Tashan Duncan
Front End Web Development Techdegree Graduate 17,774 Points

I'm curious how you would go about doing this if there were many columns.

I tried

SELECT * FROM movies Where * is NULL

And got the Error "Error: near "*": syntax error"