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

Lester Tay
Lester Tay
416 Points

Using SQL to find out all columns containing empty cells

This is a question from SQL basics but I can't seem to return to the course upon completion (can anyone teach me how to do it?)

Also, would like to ask if we want to use SQL to find out all the columns with empty cells, do we type: SELECT * FROM <sheet> WHERE <column 1> IS NULL OR <column 2> IS NULL ….<column n> IS NULL; ???

Seems like an ineffective method to me especially if there are many columns.

Thank you very much.

1 Answer

Steven Parker
Steven Parker
228,991 Points

From your home page, if you select "Completed" on the courses bar you should then be able to select any course you've finished and re-enter it.

Your code for selecting rows with empty columns seems correct and would probably be reasonably efficient even if the code itself is somewhat verbose. SQL is often like that.