" The parts table is missing values in the description column. Alter the table so that all rows have a value for description` ."
After trying on my own AND copying and pasting the Hint which was…
UPDATE parts
SET description = 'None Available'
WHERE description IS NULL;
…my table still isn’t replacing null values with “None Available”. Just to be safe I made sure that they weren’t all just blank spaces so I also tried…
UPDATE parts
SET description = 'None Available'
WHERE description = '';
This didn’t work either. Is my syntax wrong or is this a bug?
I think you’re on the right lines but there’s actually a single whitespace in the “empty” rows. You can catch it if you visually select/highlight it (how I found it). Try using ' ' instead.
here are my code and screenshot of the results, as you can see the null values are not filled!
SELECT * FROM parts
LIMIT 10;
ALTER TABLE parts
ALTER COLUMN code SET NOT NULL;
ALTER TABLE parts
ADD UNIQUE(code);
UPDATE parts
SET description = 'None Available'
WHERE description = NULL;
SELECT * FROM parts;
SELECT * FROM parts
LIMIT 10;
ALTER TABLE parts
ALTER COLUMN code SET NOT NULL;
ALTER TABLE parts
ADD UNIQUE(code);
UPDATE parts
SET description = 'None Available'
WHERE description = ' ';
SELECT * FROM parts;
Disappear or just move relative to where you’re looking? View more of the list or if it’s too long look just query rows that match your new description.
It’s mentioned in other comments but have you checked the entire query? The order of the updated rows is changed by the time you query. If rows have actually been removed then you’ll need to explain a bit more about what you did.
Ah, yes I see them at the bottom. That makes sense now that i think about it. I think SQL adds to the end of the list by default when updating. For clarity’s sake I had basically done this:
Just tried running it and it seems fine. You’re not trying to insert NULLs though, double check the instructions. The issue is that the data contains a single space character so you must match against it (instead of NULL) and replace it with the phrase the instructions provide. The structure of the query given in the hint should put you on the right track.