Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

SIKSHAPATH

SIKSHAPATH Navigation

  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Questions
  • Blog
    • Computer Science(CSE)
    • NPTEL
    • Startup
  • Shop
    • Internshala Answers
Home/Questions/Q 2082
Next
In Process
Harshdalal15
  • 0
Harshdalal15
Asked: October 31, 20212021-10-31T19:42:05+05:30 2021-10-31T19:42:05+05:30In: DBMS

update the salary of a specific employee by 10% if the salary exceeds themid range of the salary against this job

  • 0

Write a program in PL/SQLto update the salary of a specific employee by 10% if the salary exceeds themid range of the salary against this job and update up to mid range if thesalary is less than the mid range of the salary, and display a suitable messagefor users.

  • 2 2 Answers
  • 293 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. Professor
      2021-10-31T19:56:35+05:30Added an answer on October 31, 2021 at 7:56 pm

      CREATE AN ACCOUNT TO GET NOTIFICATIONS ABOUT

      NEW QUESTIONS AND ANSWERS.

       

       

      DOWNLOAD ATTACHMENT FOR ANSWER:

      Attachment

      • 0
      • Reply
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
    2. Saurav kumar
      2022-02-22T10:23:11+05:30Added an answer on February 22, 2022 at 10:23 am

      DECLARE

      emp_min_salary NUMBER(6,0);

      emp_max_salary NUMBER(6,0);

      emp_mid_salary NUMBER(6,2);

      tmp_salary EMPLOYEES.SALARY%TYPE;

      tmp_emp_id EMPLOYEES.EMPLOYEE_ID%TYPE := 167;

      tmp_emp_name EMPLOYEES.FIRST_NAME%TYPE;

      BEGIN

      SELECT  min_salary, max_salary

      INTO emp_min_salary, emp_max_salary

      FROM JOBS

      WHERE

      JOB_ID = (SELECT JOB_ID FROM EMPLOYEES WHERE EMPLOYEE_ID = tmp_emp_id);

      emp_mid_salary := (emp_min_salary + emp_max_salary) / 2;

      SELECT salary,first_name INTO tmp_salary,tmp_emp_name

      FROM employees

      WHERE employee_id = tmp_emp_id;

       IF tmp_salary < emp_mid_salary

      THEN UPDATE employees SET salary = emp_mid_salary

      WHERE employee_id = tmp_emp_id;

      ELSE UPDATE employees SET salary = salary + salary * 10 /100

      WHERE employee_id = tmp_emp_id;

      END IF;

      IF tmp_salary > emp_mid_salary

      THEN DBMS_OUTPUT.PUT_LINE(‘The employee ‘||tmp_emp_name||‘ ID ‘ || TO_CHAR(tmp_emp_id) || ‘ works in salary ‘ || TO_CHAR(tmp_salary) || ‘ which is higher than mid-range of salary ‘ || TO_CHAR(emp_mid_salary));

      ELSIF tmp_salary < emp_mid_salary THEN DBMS_OUTPUT.PUT_LINE(‘The employee ‘||tmp_emp_name||‘ ID ‘ || TO_CHAR(tmp_emp_id) || ‘ works in salary ‘ || TO_CHAR(tmp_salary) || ‘ which is lower than mid-range of salary ‘ || TO_CHAR(emp_mid_salary));

      ELSE DBMS_OUTPUT.PUT_LINE(‘The employee ‘||tmp_emp_name||‘ ID ‘ || TO_CHAR(tmp_emp_id) || ‘ works in salary ‘ || TO_CHAR(tmp_salary) || ‘ which is equal to the mid-range of salary ‘ || TO_CHAR(emp_mid_salary));

      END IF;

      END;

      • 0
      • Reply
      • Share
        Share
        • Share on WhatsApp
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    Sidebar

    Stats

    • Questions 1k
    • Answers 1k
    • Posts 139
    • Best Answers 65
    • Probability and Statistics NPTEL Assignment answers – Week 1
    • NPTEL Joy of Computing Using Python Week 2 Assignment Answers 2023
    • NPTEL Problem Solving Through Programming In C Assignment 2 Answers 2023
    • NPTEL Problem Solving Through Programming In C Assignment 1 Answers 2023
    • NPTEL Python for Data Science Assignment 1 Answers 2023

    Popular Questions

    • I'M ADMIN

      Internshala ethical hacking final test answers: Question sequence differs but ...

      • 6 Answers
    • AK

      You have a green lottery ticket, with ints a, b, ...

      • 4 Answers
    • mj

      Solve by Gauss Elimination Method 5x+y+z+w=4 ,x+7y+z+w=12 , x+y+6z+w=-5, x+y+z+4w=-6

      • 3 Answers

    Explore

    • Recent Questions
    • Questions For You
    • Answers With Time
    • Most Visited
    • New Questions
    • Recent Questions With Time

    Footer

    Helpful Links

    • Contact
    • Disclaimer
    • Privacy Policy Notice
    • TERMS OF USE
    • FAQs
    • Refund/Cancellation Policy
    • Delivery Policy for Sikshapath

    Follow

    © 2021-2022 Sikshapath. All Rights Reserved

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.