OCP 11g认证考试题库:051-123题
最新学讯:近期OCP认证正在报名中,因考试人员较多请尽快报名获取最近考试时间,报名费用请联系在线老师,甲骨文官方认证,报名从速!
我要咨询OCP 11g认证考试题库:051-123题,完整题库请点击这里联系老师咨询了解
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';
Answer: AC
试题解析:
B语法错误
D中p.prod_id不应该跟限定的表别名。
不要对USING子句中使用的列加以限定。
USING子句中引用的那些列不能在SQL 语句的任何位置使用限定词(表名或别名)。
如果在SQL 语句的另一个位置使用了同一列,则不要对其设置别名。