071-新增2

  1. View the Exhibit and examine the description of the EMPLOYEES table. You want to calculate the total remuneration for each employee. Total remuneration is the sum of the annual salary and the percentage commission earned for a year. Only a few employees earn commission. Which SQL statement would you execute to get the desired output?
    A) SELECT first_ name, salary, salary * 12+salary * commission_pct “Total” FROM EMPLOYEES;
    B) SELECT first_ name, salary, (salary+NVL(commission_ pct,0) * salary) * 12 “Total” FROM EMPLOYEES;
    C) SELECT first_ name, salary, salary * 12 + NVL(salary ,0) * commission_ pct “Total” FROM EMPLOYEES;
    D) SELECT first. name, salary, salary * 12+ (salary * NVL (commission_pct, salary,salary+commission_pct)) “Total” FROM EMPLOYEES;
  2. View the Exhibit and examine the structure of the CUSTOMERS table. CUSTOMER_VU is a view based on CUSTOMERS BR1 table which has the same structure as CUSTOMERS table.CUSTOMERS needs to be updated to reflect the latest information about the customers. What is the error in the following MERGE statement?
    MERGE INTO customers c USING customer_ vu cv ON (c.customer_ id = cv. customer_ id) WHEN MATCHED THEN UPDATE SET WHEN NOT MATCHED THENc.customer_ id = cv.customer_ id, c.cust_ name = cv.cust_ name, c.cust_ email = cv.cust_ email, c. income_ level = cv. income_ level INSERT VALUES (cv. customer. id,cv. cust_ name,cv.cust email,cv.income level) WHERE cv. income_ level >100000;
    A) The CUSTOMER_ ID column cannot be updated.
    B) The INTO clause is misplaced in the command.
    C) The WHERE clause cannot be used with INSERT.
    D) CUSTOMER _vu cannot be used as a data source.
    判断B表和A表是否满足 ON 中条件,如果满足则用 B 表去更新 A 表,如果不满足,则将 B 表数据插入 A 表但是有很多可选项, ON 里面用到的条件字段不能作为更新字段
  3. View the Exhibit and examine the structure of the sales table.
    The following query is written to retrieve all those product IDs from the SALES table that have more than 55000 sold and have been ordered more than 10 times.
    SQL> SELECT prod_id FROM sales WHERE quantity_sold > 55000 AND COUNT( * )>10 GROUP BY prod_id HAVING COUNT( * )>10;
    Which statement is true regarding this SQL statement?
    A) It executes successfully and generates the required result.
    B) It produces an error because COUNT( * ) should be specified in the SELECT clause also.
    C) It produces an error because COUNT ( * ) should be only in the HAVING clause and not in the WHERE clause.
    D) It executes successfully but produces no result because COUNT(prod_ id) should be used instead of COUNT( * ).
    统计函数用法
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值