Plz给我建议 [英] Plz give me suggestion

查看:92
本文介绍了Plz给我建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将工资增加2%,并将Comm 250增加到现有的Comm,并将经理更改为薪水大于或等于1000的所有'推销员'的工作


我尝试过:



SQL> update emp set sal = sal * 1.5

2其中sal> 1500

3

SQL> update emp set comm = nvl((comm,0)+300)

2其中comm> 0

3

SQL> update emp set job ='CLERK'

2 where job ='SALESMAN';

Increment the Salaries by 2% and add a Comm of 250 to the existing Comm and changing the Manager to Jobs of all ‘Salesman’ whose Salaries is more than or equal to 1000

What I have tried:

SQL> update emp set sal=sal*1.5
2 where sal>1500
3
SQL> update emp set comm=nvl((comm,0)+300)
2 where comm>0
3
SQL> update emp set job='CLERK'
2 where job='SALESMAN';

推荐答案

乘以1.5不会增加2% - 乘以1.02就可以了。

通过将它们与1500进行比较,得出大于或等于1000的工资。



停止随机猜测你需要什么并开始思考。

首先编写SELECT命令以返回每个条件的相关记录,并检查你得到的只是正确的记录。如果你有,请写下你的更新。

但请仔细阅读你的问题 - 此时你似乎没有试图回答你的导师设定的问题。
Multiplying by 1.5 does not increase by 2% - multiplying by 1.02 does that.
And salaries greater than or equal to 1000 is not worked out by comparing them with 1500.

Stop randomly guessing what you need and start thinking.
Start by writing SELECT commands to return the relevant records for each condition and check that what you get is only the right records. When you have that, write your UPDATES.
But read your question carefully - at the moment you don't appear to be trying to answer the question your tutor set.


这篇关于Plz给我建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆