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 trialRekha Iyengar
UX Design Techdegree Student 9,170 PointsWhat am I missing
SELECT last_name FROM phone_book WHERE phone IS NOT NULL;
4 Answers
Shayan Khan
9,842 PointsThis Worked for me:
SELECT * last_name FROM phone_book WHERE last_name IS NOT NULL;
Hope that helps out.
Sergey Podgornyy
20,660 PointsWhy do you select last_name, if you already selected all?
Shayan Khan
9,842 PointsI'm sorry, my mistake. It was supposed to be SELECT last_name FROM phone_book WHERE last_name IS NOT NULL. The question specifically asks us to only to retrieve the last name column and therefore, we need to write SELECT last_name FROM phone_book. And then write the condition to retrieve all the NON Null values in the last_name column which is WHERE last_name IS NOT NULL;. Hope that helps out!
Robert Darby
9,360 PointsNot sure what the question is but if its the one I think it is, its asking you to return everything WHERE phone IS NOT NULL not just last_name.
If that is the case it should be:
SELECT * FROM phone_book WHERE phone IS NOT NULL;
Sergey Podgornyy
20,660 PointsIt looks correct and should work properly
Rekha Iyengar
UX Design Techdegree Student 9,170 PointsThanks So much! =)
Rekha Iyengar
UX Design Techdegree Student 9,170 PointsRekha Iyengar
UX Design Techdegree Student 9,170 PointsSorry here is the question.
We're still using the phone_book, with the columns id, first_name, last_name and phone. Imagine we're implementing the autocomplete feature for a search box where you can start typing in someone's last name and suggestions will appear. Retrieve all non-NULL values from the last name column. Only retrieve the last_name column.