123.View the Exhibits and examine the structures of the PRODUCTS, SALES, and CUSTOMERS
2016-03-07 17:25
316 查看
123.View the Exhibits and examine the structures of the PRODUCTS, SALES, and CUSTOMERS
tables.
You need to generate a report that gives details of the customer's last name, name of the product, and
the quantity sold for all customers in 'Tokyo' .
Which two queries give the required result? (Choose two.)
A.SELECT c.cust_last_name,p.prod_name, s.quantity_sold FROM sales s JOIN products p
USING(prod_id) JOIN customers c USING(cust_id)
WHERE c.cust_city='Tokyo';
B.SELECT c.cust_last_name, p.prod_name, s.quantity_sold FROM products p JOIN sales s JOIN customers c
ON(p.prod_id=s.prod_id) ON(s.cust_id=c.cust_id)
WHERE c.cust_city='Tokyo';
C.SELECT c.cust_last_name, p.prod_name, s.quantity_sold FROM products p JOIN sales s
ON(p.prod_id=s.prod_id) JOIN customers c ON(s.cust_id=c.cust_id)
AND c.cust_city='Tokyo';
D.SELECT c.cust_id,c.cust_last_name,p.prod_id, p.prod_name, s.quantity_sold FROM products p JOIN sales s
USING(prod_id) JOIN customers c USING(cust_id)
WHERE c.cust_city='Tokyo';
答案:AC
解析:B这里不能两个on和两个join直接连着用,c选项using中的prod_id和cust_id这两个字段,在select中
不能加列前缀
tables.
You need to generate a report that gives details of the customer's last name, name of the product, and
the quantity sold for all customers in 'Tokyo' .
Which two queries give the required result? (Choose two.)
A.SELECT c.cust_last_name,p.prod_name, s.quantity_sold FROM sales s JOIN products p
USING(prod_id) JOIN customers c USING(cust_id)
WHERE c.cust_city='Tokyo';
B.SELECT c.cust_last_name, p.prod_name, s.quantity_sold FROM products p JOIN sales s JOIN customers c
ON(p.prod_id=s.prod_id) ON(s.cust_id=c.cust_id)
WHERE c.cust_city='Tokyo';
C.SELECT c.cust_last_name, p.prod_name, s.quantity_sold FROM products p JOIN sales s
ON(p.prod_id=s.prod_id) JOIN customers c ON(s.cust_id=c.cust_id)
AND c.cust_city='Tokyo';
D.SELECT c.cust_id,c.cust_last_name,p.prod_id, p.prod_name, s.quantity_sold FROM products p JOIN sales s
USING(prod_id) JOIN customers c USING(cust_id)
WHERE c.cust_city='Tokyo';
答案:AC
解析:B这里不能两个on和两个join直接连着用,c选项using中的prod_id和cust_id这两个字段,在select中
不能加列前缀
相关文章推荐
- codeforce 630N Forecast
- 实现TCP连接的AT指令
- 想写博客了!
- OC - 3D Touch(1)
- CABasicAnimation的基本使用方法(移动·旋转·放大·缩小)
- GET和POST请求
- 改变子窗口、弹出窗口和顶层窗口的大小、位置和Z轴次序
- HDU 5443 The Water Problem RMQ/暴力
- GetPrivateProfileInt 读取配置文件
- AChartEngine折线图实例
- PHP中MySQL、MySQLi和PDO的用法和区别
- 利用 MySQL 技能学习 DB2 Express: DB2 与 MySQL 的管理任务和基本任务
- 什么是堆和栈
- 数值的整数次方
- 小学四则运算问题
- php转码函数
- 乌班图14.10升级教程
- UVALive 2191电影收藏,伪-(动态)树状数组
- tinyos将节点号通过LED闪烁显示出来
- iOS开发自动布局第三方Snapkit