ITPub博客

首页 > 数据库 > Oracle > OCP 1Z0-051-123

OCP 1Z0-051-123

原创 Oracle 作者:LuiseDalian 时间:2014-05-22 07:26:13 0 删除 编辑
(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';



答案:(A、C)

解析:

ON和WHERE可以同时使用,ON后面还可以接AND增加过滤条件。

D(X),查询的列过多,再有就是出现在USING子句中的列,在SELECT子句中不能使用修饰符。

scott@TESTDB11>select e.empno, e.ename, e.sal, e.deptno, d.deptno, d.dname

  2  from emp e join dept d on(e.deptno = d.deptno) and empno = 7788;


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17013648/viewspace-1167131/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: OCP 1Z0-051-124
下一篇: OCP 1Z0-051-125
请登录后发表评论 登录
全部评论

注册时间:2012-02-06

  • 博文量
    1986
  • 访问量
    6040893