OCP 1Z0 051 15
2014-05-11 22:01
393 查看
15. View the Exhibit and examine the data in the CUSTOMERS table.
Evaluate the following query:
SQL> SELECT cust_name AS "NAME", cust_credit_limit/2 AS MIDPOINT,MIDPOINT+100 AS "MAX
LOWER LIMIT"
FROM customers;
The above query produces an error on execution.
What is the reason for the error?
A. An alias cannot be used in an expression.
B. The a lias NAME should not be enclosed with in double quotation marks .
C. The MIDPOINT+100 expression gives an error because CUST_CREDIT_LIMIT contains NULL
values.
D. The a lias MIDPOINT should be enclosed with in double quotation marks for the
CUST_CREDIT_LIMIT/2 expression .
别名不能在同一范围内被另一列引用。
正确的写法应该是嵌套一层
Answer: A
Evaluate the following query:
SQL> SELECT cust_name AS "NAME", cust_credit_limit/2 AS MIDPOINT,MIDPOINT+100 AS "MAX
LOWER LIMIT"
FROM customers;
The above query produces an error on execution.
What is the reason for the error?
A. An alias cannot be used in an expression.
B. The a lias NAME should not be enclosed with in double quotation marks .
C. The MIDPOINT+100 expression gives an error because CUST_CREDIT_LIMIT contains NULL
values.
D. The a lias MIDPOINT should be enclosed with in double quotation marks for the
CUST_CREDIT_LIMIT/2 expression .
别名不能在同一范围内被另一列引用。
正确的写法应该是嵌套一层
SQL> show user; User is "test" SQL> SQL> CREATE TABLE customers(cust_no,cust_name,cust_city,cust_credit_limit) AS 2 SELECT 101,'KING','NEW_YORK',100000 FROM DUAL UNION ALL 3 SELECT 102,'GREEN','BOSTON',150000 FROM DUAL UNION ALL 4 SELECT 103,'SCOTT','LONDON',NULL FROM DUAL UNION ALL 5 SELECT 104,'SMITH','BOSTON',NULL FROM DUAL; Table created SQL> SELECT "NAME",MIDPOINT,MIDPOINT+100 AS "MAX 2 LOWER LIMIT" 3 FROM 4 ( 5 SELECT cust_name AS "NAME", cust_credit_limit/2 AS MIDPOINT 6 FROM customers); NAME MIDPOINT MAX LOWER LIMIT ----- ---------- --------------- KING 50000 50100 GREEN 75000 75100 SCOTT SMITH
Answer: A
相关文章推荐
- OCP 1Z0 051 QUESTION NO: 15
- OCP-1Z0-新051-61题版本-15
- OCP-1Z0-051-2015-15题
- OCP-1Z0-051-2015-2题
- ocp 1Z0-051 106-140题解析
- OCP-1Z0-新051-61题版本-12
- OCP-1Z0-新051-61题版本-27
- OCP-1Z0-新051-61题版本-41
- OCP-1Z0-新051-61题版本-57
- OCP-1Z0-051-2015-18题
- OCP-1Z0-051-2015-26题
- OCP-1Z0-051 第6题 case when和decode的用法
- OCP-1Z0-051 第36题 建表语句加约束
- OCP-1Z0-051 第46题 约束和索引
- OCP-1Z0-051 第67题 ORDER BY子句应用
- OCP 1Z0 051 5
- OCP-1Z0-051 第95题 NVL,NVL2函数用法
- OCP-1Z0-051 第109题 聚合函数的使用
- OCP 1Z0 051 12
- OCP-1Z0-051-V9.02-1题