您的位置:首页 > 其它

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中

不能加列前缀
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: