Setting commission for employees based on position

Setting commission for employees based on position

I just started to learn some sql and I am using oracle database 11g. The question I have is that I have a staff table where I am trying to update the commission for each staff based on the position of the staff. I wanted to update the commission for regular employees to be 0.04(4%) and 0.05(5%) for managers.

I just started to learn some sql and I am using oracle database 11g. The question I have is that I have a staff table where I am trying to update the commission for each staff based on the position of the staff. I wanted to update the commission for regular employees to be 0.04(4%) and 0.05(5%) for managers.

Is there a way to do this all in one statement?

The way I did it was that I just updated all the staff commission by :

UPDATE staff SET commission = 0.04;

then I did another update statement to update just the manger

UPDATE staff SET commission = 0.05 WHERE position = 'Manager';

I was thinking something along the lines of this however this wouldnt work lol.

UPDATE staff SET commission = 0.04 WHERE NOT position = 'Manager' AND SET commission = 0.05
WHERE position = 'Manager';

Thanks for your help! much appreciated!

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

An Introduction to Oracle SQL

An Introduction to Oracle SQL: A quick tour of the six principal clauses of the SELECT statement.

What are the differences between Standard SQL and Transact-SQL?

In this article, we'll explain syntax differences between standard SQL and the Transact-SQL language dedicated to interacting with the SQL

SQL Server Tutorial For Beginners - Learn MS SQL Server with Examples

SQL Server Tutorial For Beginners, Microsoft SQL Server Tutorial, SQL Server Training. Microsoft SQL Server explains all the fundamentals of MS SQL Server with examples. What is DBMS? What is SQL? What is SQL Server? SQL Server Installation