My issue
Why my answer is showing the same as expected output but still after submitting it shows wrong answer?
My code:
Alter Table Financials
Add Remark int;
update Financials
set Remark =
case when month = ‘Mar’ then ‘Loss due to Covid’
when month = ‘Apr’ then ‘Loss due to Covid’
when month = 'May’then ‘Loss due to Covid’
else ‘This is fine’
end;
select *
from Financials
limit 10;
My code
/* Write a query which does the following
- Add a column - 'Remarks' - at the end of the table
- Add the following remark to all entries
- For the month 'Mar', 'Apr', 'May' - the remark should be 'Loss due to Covid'
- For all other months - the remark should be 'This is fine' */
Alter Table Financials
Add Remark int;
update Financials
set Remark =
case when month = 'Mar' then 'Loss due to Covid'
when month = 'Apr' then 'Loss due to Covid'
when month = 'May'then 'Loss due to Covid'
else 'This is fine'
end;
select *
from Financials
limit 10;
Learning course: SQL at Work
Problem Link: CodeChef: Practical coding for everyone