SQL查询纠正错误 [英] Sql queries to correct mistakes

查看:66
本文介绍了SQL查询纠正错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有些更新和删除的问题,有些是完成的,有些是完整的,我不明白,请帮我纠正错误,如果有的话。谢谢



插入新员工的记录,其中包含empno 123和名称Ronaldo

Ans)插入emp(empno和name)值(123,Ronaldo);





删除销售部门的记录

Ans)从salesdepart删除;



更改Smith的员工地址

Ans)





将每位员工的薪水更新为5000.

Ans)更新emp set salary = sal + 5000;



更改每位员工的经理7934.

答)



将部门20的佣金更改为1000.



答)

将所有职员的职位更改为02-04-2000。

Ans)更新emp set hiredate = 02-04 -2000 where job =Clerk;

将所有推销员的雇员更改为02年3月2日,其中部门号为30.

Ans)

更新名称以A开头的每位员工的工资。

答案)

删除所有记录为deptno 20的记录。

Ans)从emp中删除deptno = 20;



删除薪水大于2000的所有记录。

Ans)从emp删除工资> 2000;

Some queries of update and delete, Some are completed and some are left to be complete, which i don't understand, please help me to correct mistakes if there any.Thanks

Insert new employee’s records having empno 123 and name Ronaldo
Ans) insert into emp(empno and name) values(123,Ronaldo);


Delete the records of Sales department
Ans) Delete from salesdepart;

Change the employees address for Smith
Ans)


Update the salary of each employee to 5000.
Ans) Update emp set salary= sal+5000;

Change the Mgr of each employee 7934.
Ans)

Change the commission of department 20 to 1000.

Ans)
Change the hiredate of all clerk to 02-04-2000.
Ans) Update emp set hiredate= 02-04-2000 where job="Clerk";
Change the hiredate of all salesman to 02-March-99 where department no is 30.
Ans)
Update the salary of each employee whose name start with ‘A’.
Ans)
Delete all the records having deptno 20.
Ans) Delete from emp where deptno=20;

Delete all records where salary is greater than 2000.
Ans) Delete from emp where salary > 2000;

推荐答案

我们不做你的作业:它是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是和你想的一样困难!
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!


这篇关于SQL查询纠正错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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