SlideShare a Scribd company logo
1 of 47
Code
Begin
   declare c anchor empPr.salary;
  select salary into c from empPr where id=2;
  if(c>40000) then
      update empPr set salary=c+1000 where
      id=2;
  end if;
end
Code
begin
  declare c anchor empPr.salary;
  select salary into c from empPr where id=2 ;
  if(c>40000) then
      update empPr set salary=c+1000 where id=2;
  else
      update empPr set salary=c+500 where id=2;
  end if;
end ;
Code
begin
  declare c anchor empPr.salary;
   declare bonus int;
  select salary into c from empPr where id=2 ;
  case c
       when 50000 then
               set bonus=c+1000;
       when 30000 then
              set bonus=c+500;
       else
              set bonus=c;
  end case;
  update empPr set salary=bonus where id=2;
end ;
Code
begin
   declare c anchor empPr.salary;
    declare bonus int;
   select salary into c from empPr where id=2 ;
   case
         when C<=40000 then
                   set bonus=c+500;
         when c<=50000 then
                   set bonus=c+1000;
         else
                    set bonus=c+2000;
    end case;
   update empPr set salary=bonus where id=2;
end ;
Code
create type emp as row anchor row of empPr;
BEGIN
   declare e1 emp;
   L:
       for e1 as select * from empPr DO
               if( e1.salary < 30000) THEN
                        Iterate L;
                end if;
               update empPr set salary=e1.salary+1000
       where id=e1.id;
       end for L;
END;
Code
create type e1 as row anchor row of empPr;
BEGIN
   declare total_sal int;
   set total_sal = 0;
    ADD :
         for e1 as select * from empPr DO
                   Set total_sal=total_sal+e1.salary;
                  if( total_sal >100000)
                            leave ADD:
                  end if;
          end for ADD;
END;
8
Update employee salary based on conditions
Update employee salary based on conditions
Update employee salary based on conditions
Update employee salary based on conditions
Update employee salary based on conditions

More Related Content

Viewers also liked

The group data net
The group data netThe group data net
The group data netlalupu
 
افات امتثال السيولة Maan
افات امتثال السيولة Maanافات امتثال السيولة Maan
افات امتثال السيولة MaanMaan Barazi
 
Cravatte, chignon e social web_ Quattro @Roverbella
Cravatte, chignon e social web_ Quattro @RoverbellaCravatte, chignon e social web_ Quattro @Roverbella
Cravatte, chignon e social web_ Quattro @RoverbellaValentina Tosi
 
114. mc k part 3 hbo
114. mc k part 3   hbo114. mc k part 3   hbo
114. mc k part 3 hboHispros
 
الثورة السورية بين العنف واللاعنف
الثورة السورية بين العنف واللاعنفالثورة السورية بين العنف واللاعنف
الثورة السورية بين العنف واللاعنفMuhammad Naseh Abdulla
 
20131019 生物物理若手 Journal Club
20131019 生物物理若手 Journal Club20131019 生物物理若手 Journal Club
20131019 生物物理若手 Journal ClubMed_KU
 
Molekulární vodík
Molekulární vodíkMolekulární vodík
Molekulární vodíkDavid Sach
 
8 Years Ago, and 8 Years Later Again
8 Years Ago, and 8 Years Later Again8 Years Ago, and 8 Years Later Again
8 Years Ago, and 8 Years Later AgainMaria Fatima
 
Wspei Supports And Services
Wspei Supports And ServicesWspei Supports And Services
Wspei Supports And ServicesEvelyn Azbell
 
مؤشر كتابة النص التفعيلي
مؤشر كتابة النص التفعيليمؤشر كتابة النص التفعيلي
مؤشر كتابة النص التفعيليAbu Ali Talluza
 
Bailes 100311035514-phpapp02
Bailes 100311035514-phpapp02Bailes 100311035514-phpapp02
Bailes 100311035514-phpapp02mcardenas2020
 
Manuaalinen purkuilmaventtiili
Manuaalinen purkuilmaventtiiliManuaalinen purkuilmaventtiili
Manuaalinen purkuilmaventtiiliCarolina Morales
 

Viewers also liked (19)

Allians för sjukvården i sörmland 5 år vid makten
Allians för sjukvården i sörmland   5 år vid maktenAllians för sjukvården i sörmland   5 år vid makten
Allians för sjukvården i sörmland 5 år vid makten
 
The group data net
The group data netThe group data net
The group data net
 
افات امتثال السيولة Maan
افات امتثال السيولة Maanافات امتثال السيولة Maan
افات امتثال السيولة Maan
 
Proyecto Ocaña
Proyecto OcañaProyecto Ocaña
Proyecto Ocaña
 
Cravatte, chignon e social web_ Quattro @Roverbella
Cravatte, chignon e social web_ Quattro @RoverbellaCravatte, chignon e social web_ Quattro @Roverbella
Cravatte, chignon e social web_ Quattro @Roverbella
 
Connectis en Castilla y León Económica
Connectis en Castilla y León EconómicaConnectis en Castilla y León Económica
Connectis en Castilla y León Económica
 
Tivi+
Tivi+Tivi+
Tivi+
 
Session 43 Mats Hollander
Session 43 Mats HollanderSession 43 Mats Hollander
Session 43 Mats Hollander
 
114. mc k part 3 hbo
114. mc k part 3   hbo114. mc k part 3   hbo
114. mc k part 3 hbo
 
الثورة السورية بين العنف واللاعنف
الثورة السورية بين العنف واللاعنفالثورة السورية بين العنف واللاعنف
الثورة السورية بين العنف واللاعنف
 
السكان
السكانالسكان
السكان
 
20131019 生物物理若手 Journal Club
20131019 生物物理若手 Journal Club20131019 生物物理若手 Journal Club
20131019 生物物理若手 Journal Club
 
Molekulární vodík
Molekulární vodíkMolekulární vodík
Molekulární vodík
 
8 Years Ago, and 8 Years Later Again
8 Years Ago, and 8 Years Later Again8 Years Ago, and 8 Years Later Again
8 Years Ago, and 8 Years Later Again
 
Wspei Supports And Services
Wspei Supports And ServicesWspei Supports And Services
Wspei Supports And Services
 
مؤشر كتابة النص التفعيلي
مؤشر كتابة النص التفعيليمؤشر كتابة النص التفعيلي
مؤشر كتابة النص التفعيلي
 
Bailes 100311035514-phpapp02
Bailes 100311035514-phpapp02Bailes 100311035514-phpapp02
Bailes 100311035514-phpapp02
 
Almassar2
Almassar2Almassar2
Almassar2
 
Manuaalinen purkuilmaventtiili
Manuaalinen purkuilmaventtiiliManuaalinen purkuilmaventtiili
Manuaalinen purkuilmaventtiili
 

More from Abha Damani (20)

Unit2
Unit2Unit2
Unit2
 
Unit6
Unit6Unit6
Unit6
 
Unit5
Unit5Unit5
Unit5
 
Unit4
Unit4Unit4
Unit4
 
Unit3
Unit3Unit3
Unit3
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programming
 
Ch14
Ch14Ch14
Ch14
 
Ch12
Ch12Ch12
Ch12
 
Ch11
Ch11Ch11
Ch11
 
Ch10
Ch10Ch10
Ch10
 
Ch08
Ch08Ch08
Ch08
 
Ch01 enterprise
Ch01 enterpriseCh01 enterprise
Ch01 enterprise
 
3 data mgmt
3 data mgmt3 data mgmt
3 data mgmt
 
2 it supp_sys
2 it supp_sys2 it supp_sys
2 it supp_sys
 
1 org.perf it supp_appl
1 org.perf it supp_appl1 org.perf it supp_appl
1 org.perf it supp_appl
 
Managing and securing the enterprise
Managing and securing the enterpriseManaging and securing the enterprise
Managing and securing the enterprise
 
Ch6
Ch6Ch6
Ch6
 
Unit 3
Unit 3Unit 3
Unit 3
 
Unit 4
Unit 4Unit 4
Unit 4
 
Unit 5
Unit 5Unit 5
Unit 5
 

Recently uploaded

Intro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdfIntro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdfpollardmorgan
 
Digital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfDigital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfJos Voskuil
 
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607dollysharma2066
 
Organizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessOrganizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessSeta Wicaksana
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCRashishs7044
 
Pitch Deck Teardown: NOQX's $200k Pre-seed deck
Pitch Deck Teardown: NOQX's $200k Pre-seed deckPitch Deck Teardown: NOQX's $200k Pre-seed deck
Pitch Deck Teardown: NOQX's $200k Pre-seed deckHajeJanKamps
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Servicecallgirls2057
 
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptxContemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptxMarkAnthonyAurellano
 
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
Tech Startup Growth Hacking 101  - Basics on Growth MarketingTech Startup Growth Hacking 101  - Basics on Growth Marketing
Tech Startup Growth Hacking 101 - Basics on Growth MarketingShawn Pang
 
Keppel Ltd. 1Q 2024 Business Update Presentation Slides
Keppel Ltd. 1Q 2024 Business Update  Presentation SlidesKeppel Ltd. 1Q 2024 Business Update  Presentation Slides
Keppel Ltd. 1Q 2024 Business Update Presentation SlidesKeppelCorporation
 
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu MenzaYouth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menzaictsugar
 
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,noida100girls
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...lizamodels9
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Kirill Klimov
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,noida100girls
 
India Consumer 2024 Redacted Sample Report
India Consumer 2024 Redacted Sample ReportIndia Consumer 2024 Redacted Sample Report
India Consumer 2024 Redacted Sample ReportMintel Group
 
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdfNewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdfKhaled Al Awadi
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCRashishs7044
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...lizamodels9
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis UsageNeil Kimberley
 

Recently uploaded (20)

Intro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdfIntro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdf
 
Digital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfDigital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdf
 
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
 
Organizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessOrganizational Structure Running A Successful Business
Organizational Structure Running A Successful Business
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
 
Pitch Deck Teardown: NOQX's $200k Pre-seed deck
Pitch Deck Teardown: NOQX's $200k Pre-seed deckPitch Deck Teardown: NOQX's $200k Pre-seed deck
Pitch Deck Teardown: NOQX's $200k Pre-seed deck
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
 
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptxContemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
 
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
Tech Startup Growth Hacking 101  - Basics on Growth MarketingTech Startup Growth Hacking 101  - Basics on Growth Marketing
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
 
Keppel Ltd. 1Q 2024 Business Update Presentation Slides
Keppel Ltd. 1Q 2024 Business Update  Presentation SlidesKeppel Ltd. 1Q 2024 Business Update  Presentation Slides
Keppel Ltd. 1Q 2024 Business Update Presentation Slides
 
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu MenzaYouth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
 
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Greater Noida ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
 
India Consumer 2024 Redacted Sample Report
India Consumer 2024 Redacted Sample ReportIndia Consumer 2024 Redacted Sample Report
India Consumer 2024 Redacted Sample Report
 
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdfNewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage
 

Update employee salary based on conditions

  • 1.
  • 2.
  • 3.
  • 4.
  • 5. Code Begin declare c anchor empPr.salary; select salary into c from empPr where id=2; if(c>40000) then update empPr set salary=c+1000 where id=2; end if; end
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Code begin declare c anchor empPr.salary; select salary into c from empPr where id=2 ; if(c>40000) then update empPr set salary=c+1000 where id=2; else update empPr set salary=c+500 where id=2; end if; end ;
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18. Code begin declare c anchor empPr.salary; declare bonus int; select salary into c from empPr where id=2 ; case c when 50000 then set bonus=c+1000; when 30000 then set bonus=c+500; else set bonus=c; end case; update empPr set salary=bonus where id=2; end ;
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24. Code begin declare c anchor empPr.salary; declare bonus int; select salary into c from empPr where id=2 ; case when C<=40000 then set bonus=c+500; when c<=50000 then set bonus=c+1000; else set bonus=c+2000; end case; update empPr set salary=bonus where id=2; end ;
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. Code create type emp as row anchor row of empPr; BEGIN declare e1 emp; L: for e1 as select * from empPr DO if( e1.salary < 30000) THEN Iterate L; end if; update empPr set salary=e1.salary+1000 where id=e1.id; end for L; END;
  • 35.
  • 36.
  • 37. Code create type e1 as row anchor row of empPr; BEGIN declare total_sal int; set total_sal = 0; ADD : for e1 as select * from empPr DO Set total_sal=total_sal+e1.salary; if( total_sal >100000) leave ADD: end if; end for ADD; END;
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. 8