Skip to Main Content
  • Questions
  • Write a SQL Query to Calculate New Salaries

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Athi.

Asked: January 18, 2023 - 5:52 pm UTC

Last updated: January 19, 2023 - 12:30 am UTC

Version: 10

Viewed 1000+ times

You Asked

Assume that the company you work in wants to increase the salaries by 20% this year, and also wants to add 1000 as bonus to each salary after 20% increase. Based on this information, write a SQL query that returns the new salaries from the EMPLOYEES table.

Your query should return the employee_id, salary and new_salary columns. (new_salary should be the alias for the calculated salary)

and Connor said...

Sounds like homework :-)

So if the column is SALARY, then adding 20% is the same as multiplying by 1.2

Thus new salary will be SALARY*1.2 + 1000

That should you get you going.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

SQL

The Oracle documentation contains a complete SQL reference.