ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 047-074

047-074

原创 Linux操作系统 作者:jbymy2000 时间:2012-03-18 10:26:38 0 删除 编辑
74. View the Exhibit and examine the structure of the ORDER_ITEMS and ORDERS
tables.
You are asked to retrieve the ORDER_ID, PRODUCT_ID, and total price
(UNIT_PRICE multiplied by QUANTITY), where the total price is greater than
50,000.
You executed the following SQL statement:
SELECT order_id, product_id, unit_price*quantity "Total Price"
FROM order_items
WHERE unit_price*quantity > 50000 NATURAL JOIN orders;
Which statement is true regarding the execution of the statement?
A. The statement would execute and provide the desired result.
B. The statement would not execute because the ON keyword is missing in the
NATURAL JOIN clause.
C. The statement would not execute because the WHERE clause is before the
NATURAL JOIN clause.
D. The statement would not execute because the USING keyword is missing in
the NATURAL JOIN
clause.
Answer: C
1: SQL> select deptno,ename from dept natural join emp where deptno>30;
Ok
2: SQL> select deptno,ename from dept where deptno>30 natural join emp;
ORA-00933: SQL 命令未正确结束
自然连接(NATURAL JOIN)是一种特殊的等价连接,它将表中具有相同名称的列
自动进行记录匹配。自然连接不必指定任何同等连接条件。

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

上一篇: 047-073
下一篇: 047-075
请登录后发表评论 登录
全部评论

注册时间:2012-01-10

  • 博文量
    416
  • 访问量
    204201