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

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

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,799 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"