Skip to content

Instantly share code, notes, and snippets.

@aveek22
Created January 9, 2021 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aveek22/df9adcb32dc8a1aaf0aea46b19c1c578 to your computer and use it in GitHub Desktop.
Save aveek22/df9adcb32dc8a1aaf0aea46b19c1c578 to your computer and use it in GitHub Desktop.
ALTER TABLE mumbai_house_price_raw
ADD COLUMN house_price_category VARCHAR(20);
UPDATE mumbai_house_price_raw
SET house_price_category = CASE WHEN price < 20000 THEN 'Below 20K'
WHEN price >= 20000 AND price < 40000 THEN '20K - 40K'
WHEN price >= 40000 THEN 'Above 50K'
END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment