Alter exercise


#1


https://www.codecademy.com/en/courses/learn-sql/lessons/manipulation/exercises/alter?action=resume


When I try to run it, nothing happens. I am very confused.


UPDATE celebs
SET twitter_handle = '@oallam26'
WHERE id = 3;

SELECT * FROM celebs;

DELETE FROM celebs WHERE twitter_handle IS NULL;


UPDATE celebs
SET twitter_handle = '@oallam26'
WHERE id = 3;


SELECT * FROM celebs;

DELETE FROM celebs WHERE twitter_handle IS NULL;


#2

write DELETE command above SELECT


#3

Thanks.

It deleted all the rows without twitter_handle, but the instruction still isn't being checked.

THis is my code:

UPDATE celebs
SET twitter_handle = '@oallam26'
WHERE id = 3;

DELETE FROM celebs WHERE twitter_handle IS NULL;

SELECT * FROM celebs;


#4

This actually works

UPDATE celebs
SET twitter_handle = '@taylorswift13'
WHERE id = 4;

DELETE FROM celebs WHERE twitter_handle IS NULL;

SELECT * FROM celebs;


#5

Yea the above still isn't working. I've typed everything to a T and still nothing.


#6

Ok. Figured it out. You have to enter it twice. Like so:

UPDATE celebs
SET twitter_handle = '@taylorswift13'
WHERE id = 4;
DELETE FROM celebs WHERE twitter_handle IS NULL;
SELECT * FROM celebs;

DELETE FROM celebs WHERE twitter_handle IS NULL;


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.