电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

数据库第六次实验

数据库第六次实验_第1页
数据库第六次实验_第2页
数据库第六次实验_第3页
请完成以下实验内容:declare cust cursor forselect customerno,customername,address,telephone,zipfrom customeropen custbeginendclose custdeallocate cust(2) 利用游标修改 OrderMaster 表中 Ordersum 的值。declare ordermas cursor forselect a.orderno,sum(b.quantity*b.price)from ordermaster a,orderdetail bwhere a.orderno=b.ordernogroup by a.ordernoopen ordermas begin update ordermasterend close ordermasdeallocate ordermas结果查看:select *from ordermasteras declare chan cursor forselect employeenofrom employeeorder by employeeno descopen chanbegin ENDclose chandeallocate chanexec chansheng 3(产生三个)as declare chan cursor forselect employeeno,employeename,salaryfrom employeeopen chanbegin ENDclose chandeallocate chan执行:exec empname '李'(6) 创建存储过程,要求:输入年度,计算每个业务员的年终奖金额。年终奖金=年销售总额×提成率。提成率规则如下:年销售总额 5000 元以下部分,提成率为 10%,对于 5000 元及超过 5000 元部分,则提成率为 15%。as declare chan cursor forselect a.employeeno,a.employeename,sum(b.ordersum) group by a.employeeno,a.employeenameorder by sum(b.ordersum) descopen chanbeginbeginendbeginendbeginendENDclose chandeallocate chan执行:exec p_salary 2024(9) 创建存储过程,要求将 OrderMaster 表中每一个订单所对应的明细数据信息按规定格式输出,格式如下:==== 订单及其明细数据信息 ====------------------------------------------------------------------------P20240001 5 403.50P20240002 3 2100.00P20240003 2 600.00create procedure proorderas declare chan cursor forselect a.orderno,b.productno,b.quantity,b.pricefrom ordermaster a,orderdetail bwhere a.orderno=b.ordernoorder by a.orderno open chanbeginbeginendelsebeginendENDclose chandeallocate chan执行:exec proorder======== 客户订单表 ======== ----------------------------------------- 客户名称:统一股份有限公司 客户地址:天津市 总金额:31121.86 ----------------------------------------- P20240001 5 80.7...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

范哲铺+ 关注
实名认证
内容提供者

想你所想,急你所急,你需要的都在店铺里可以找到。

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部