137.View the Exhibits and examine PRODUCTS and SALES tables.
来源:互联网 发布:淘宝店9.9包邮 编辑:程序博客网 时间:2024/05/17 23:51
137.View the Exhibits and examine PRODUCTS and SALES tables.
You issue the following query to display product name and the number of times the product has been
sold:
SQL>SELECT p.prod_name, i.item_cnt FROM (SELECT prod_id, COUNT(*) item_cnt FROM sales
GROUP BY prod_id) i RIGHT OUTER JOIN products p ON i.prod_id = p.prod_id;
What happens when the above statement is executed?
A.The statement executes successfully and produces the required output.
B.The statement produces an error because ITEM_CNT cannot be displayed in the outer query.
C.The statement produces an error because a subquery in the FROM clause and outer-joins cannot be used together.
D.The statement produces an error because the GROUP BY clause cannot be used in a subquery in the FROM clause.
答案:A
You issue the following query to display product name and the number of times the product has been
sold:
SQL>SELECT p.prod_name, i.item_cnt FROM (SELECT prod_id, COUNT(*) item_cnt FROM sales
GROUP BY prod_id) i RIGHT OUTER JOIN products p ON i.prod_id = p.prod_id;
What happens when the above statement is executed?
A.The statement executes successfully and produces the required output.
B.The statement produces an error because ITEM_CNT cannot be displayed in the outer query.
C.The statement produces an error because a subquery in the FROM clause and outer-joins cannot be used together.
D.The statement produces an error because the GROUP BY clause cannot be used in a subquery in the FROM clause.
答案:A
0 0
- 137.View the Exhibits and examine PRODUCTS and SALES tables.
- 153.View the Exhibits and examine the structures of the PRODUCTS and SALES tables.
- 120.View the Exhibits and examine the structures of the PRODUCTS, SALES, and CUSTOMERS
- 123.View the Exhibits and examine the structures of the PRODUCTS, SALES, and CUSTOMERS
- 129.View the Exhibits and examine the structures of the PROMOTIONS and SALES tables.
- 1.View the Exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS, and TIMES tables.
- 132.View the Exhibit and examine the structure of the SALES and PRODUCTS tables.
- 162.View the Exhibit and examine the structure of the PRODUCTS, SALES, and SALE_SUMMARY tables.
- 40.View the Exhibit to examine the description for the SALES and PRODUCTS tables.
- 149.View the Exhibits and examine the structures of the COSTS and PROMOTIONS tables.
- 169.View the Exhibit and examine the description for the PRODUCTS and SALES table.
- 124.View the Exhibit and examine the structure of the PROMOTIONS, SALES, and CUSTOMER tables.
- 161.View the exhibit and examine the description for the SALES and CHANNELS tables.
- 164.View the Exhibit and examine the structure of CUSTOMERS and SALES tables.
- 168.View the Exhibit and examine the description of SALES and PROMOTIONS tables.
- 154.View the Exhibit and evaluate structures of the SALES, PRODUCTS, and COSTS tables.
- 148.View the Exhibit and examine the structure of the PRODUCTS tables.
- 52.View the Exhibits and examine lock waits. Users HR and SH complain that their transactions on one
- 设计模式:适配器模式
- Shell基础(二):Bash变量
- POJ 3991 Seinfeld
- js获取当前系统时间 && js获取当前系统时间-24小时 && 当前系统时间+24小时
- phpstorm中$_post无法传值的问题 与文件无法上传问题
- 137.View the Exhibits and examine PRODUCTS and SALES tables.
- opencl:cl::make_kernel的进化
- Pycharm中的中文文件名只能显示口口口口口口口口口的解决方法
- JDK常用的package
- C#读取文本文件
- JavaScript DOM 操作总结
- SecureCRT连接Ubuntu失败(远程系统拒绝访问)
- Caffe基础介绍
- 线性时间排序C++代码集合(计数排序,基数排序,桶排序([0~1)的浮点数))