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

Data Analysis

Challenge SQL 2/3 delete the user with the username poley-hand from eCommerce database users/ bummer you did not delete

DELETE first_name,last_name, user, Id FROM users WHERE poley_hand is null IN ( password , username); SQL BEGINNERS, what ever I do:" you did not delete the correct column. I draw on the paper, involving all column, also tried. SELECT FROM WHEN IN AS( I just can't after hours, please help

2 Answers

Steven Parker
Steven Parker
231,198 Points

It took a bit of searching to find the challenge you are (were?) working on. The instructions are: "Delete the user with the username of poley_hands." :point_left: notice the "s".

Since the DELETE operation always removes entire rows, you don't need to specify any columns except for the WHERE clause, and then you identify which row(s) to remove based on the contents. So in this case:

DELETE FROM users WHERE username = 'poley_hands';
Greg Harris
Greg Harris
43,362 Points

First, you don't need to declare columns to delete as SQL is deleting the record. For safety, you can include the *

Second, you only need to specify their username in the WHERE clause and you need to pass the value. See below

DELETE * FROM users WHERE username = "poley-hand"

according to what you have provided about the db in question this should work