clear markdown compare help donate or buy diddy dollings comments/suggestions/bugs a leap of faith? bible365
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 582687 fiddles created (13286 in the last week).

create table members (member_id int, experience int);
 hidden batch(es)


insert into members values (1,2200),(2,3800),(3,7800);
 hidden batch(es)


create or replace view member_level as select member_id , experience , case when experience between 0 and 999 then 'level 1' when experience between 1000 and 2399 then 'level 2' when experience between 2400 and 3999 then 'level 3' when experience between 4000 and 7999 then 'level 4' when experience between 8000 and 14999 then 'level 5' when experience between 15000 and 23999 then 'level 6' when experience between 24000 and 34999 then 'level 7' when experience between 35000 and 49999 then 'level 8' when experience >= 50000 THEN 'level 9' end as level_ from members ;
 hidden batch(es)


select * from members;
member_id experience
1 2200
2 3800
3 7800
 hidden batch(es)


select * from member_level;
member_id experience level_
1 2200 level 2
2 3800 level 3
3 7800 level 4
 hidden batch(es)


update members set experience = 27500 where member_id = 1 ;
 hidden batch(es)


select * from member_level;
member_id experience level_
1 27500 level 7
2 3800 level 3
3 7800 level 4
 hidden batch(es)