I have a ‘category’ column, but the error message says “Add a category column.”
It looks like the instructions and the code are correct, but there’s an error parsing the submitted answer.
Did I do something wrong?
Code:
select *,
case name
when 'kale-smoothie' then 'smoothie'
when 'banana-smoothie' then 'smoothie'
when 'orange-juice' then 'drink'
when 'soda' then 'drink'
when 'blt' then 'sandwich'
when 'tikka-masala' then 'dinner'
when 'chicken-parm' then 'dinner'
else 'other'
end as category
from order_items
order by id
limit 100;
We’ll build our own categories using a case statement. Complete the query below with a case condition of name that lists out each product, and decides its group.
Thanks @mtf! That’ll teach me not to type when I can simply copy / paste I think this does highlight a bug in Codecademy’s parser, though. The problem had nothing to do with the category column.
I got the same error and i didnt miss grilled cheese:
select *,
case name
when ‘kale-smoothie’ then ‘smoothie’
when ‘banana-smoothie’ then ‘smoothie’
when ‘orange-juice’ then ‘drink’
when ‘grilled-cheese’ then ‘sandwich’
when ‘tikka-masala’ then ‘dinner’
when ‘chicken-parm’ then ‘dinner’
else ‘other’
end
as category
from order_items
order by id
limit 100;
select *,
case name
when ‘kale-smoothie’ then
‘smoothie’
when ‘orange-juice’ then
‘drink’
when ‘soda’ then
‘drink’
when ‘blt’ then
‘sandwhich’
when ‘grilled-cheese’ then
‘sandwhich’
when ‘tikka-masala’ then
‘dinner’
when ‘chicken-parm’ then
‘dinner’
else ‘other’
end
as category
from order_items
order by id
limit 100;