【2019年8月】OCP 071认证考试最新版本的考试原题-第32题

choose three

Examine this SQL statement:

SELECT custid, cus last_name "Last Name"

FROM customers

WHERE country_id = 10

UNION

SELECT cust_id CUST_NO, cust_last_name

FROM customers

WHERE country_id = 30

Identify three ORDER BY clauses, any one of which can complete the query successfully.

A) ORDERBY 2, 1

B) ORDER BY "CUST_NO"

C) ORDER BY 2,cust_id

D) ORDER BY CUST_NO

E) ORDER BY "Last Name"

Answer:ACE

(解析:此题的解析跟下面的解析一样,答案就是按照解析的总结规律找出来的。)

071-140 题目:

SELECT department_id "DEPT_ID", department_name, ‘b‘ FROM departments

WHERE department_id=90 UNION

SELECT department_id, department_name DEPT_NAME, ‘a‘ FROM departments

WHERE department_id=10

Which two ORDER BY clauses can be used to sort output?

A. ORDER BY DEPT_NAME;

B. ORDER BY DEPT_ID;

C. ORDER BY ‘b‘;

D. ORDER BY 3;

Correct Answer: BD

(解析:通过实验发现别名必须是用双引号概括起来的才可以用来排序;而且发现取了别名(别名用双引号概括)的列的名字也不能用来排序;没有用双引号概括起来的别名的列名可以用来排序;order by 3,可以根据显示的列的顺序进行排序。

注意 union 排序的的时候 order by 要写在语句的最后;发现只能在第一条 select 语句中的列进行排序。)

SQL> select empno "CUST_NO",ename "LAST NAME",‘a‘ FROM emp

2 UNION

3 SELECT EMPNO ,ENAME,‘b‘ FROM emp

4 ORDER BY empno;

ORDER BY empno

*

第 4 行出现错误:

ORA-00904: "EMPNO": 标识符无效

原文地址:https://blog.51cto.com/13854012/2451432

时间: 2024-09-28 07:22:06

【2019年8月】OCP 071认证考试最新版本的考试原题-第32题的相关文章

【2019年8月】OCP 071认证考试最新版本的考试原题-第16题

Choose two. Examine this partial command: CREATE TABLE cust ( cust_id NUMBER(2), credit_ limit NUMBER(10) ) ORGANIZATION EXTERNAL Which two clauses are required for this command to execute successfully? A) the DEFAULT DIRECTORY clause B) the REJECT L

【2019年8月】OCP 071认证考试最新版本的考试原题-第28题

choose two The ORDERS table has a column ORDER_DATE of date type DATE The default display format for a date is DD-MON-RR Which two WHERE conditions demonstrate the correct usage of conversion functions? A) WHERE ordet_date > TO_CRAR(ADD_MONTHS(SYSDAT

【2019年8月版本】OCP 071认证考试最新版本的考试原题-第2题

choose three Which three are true about the CREATE TABLE command? A) It can include the CREATE...INDEX statement for creating an index to enforce the primary key constraint. B) The owner of the table should have space quota available on the tablespac

【2019年8月版本】OCP 071认证考试最新版本的考试原题-第3题

choose two The CUSTOMERS table has a CUST_CREDT_LIMIT column of date type number. Which two queries execute successtully? A) SELECT TO_CHAR(NVL(cust_credit_limit * .15,'Not Available')) FROM customers; B) SELECT NVL2(cust_credit_limit * .15,'Not Avai

【2019年8月版本】OCP 071认证考试最新版本的考试原题-第5题

choose the best answer The CUSTOMERS table has a CUST_LAST_NAME column of data type VARCHAR2. The table has two rows whose COST_LAST_MANE values are Anderson and Ausson. Which query produces output for CUST_LAST_SAME containing Order for the first ro

【2019年8月版本】OCP 071认证考试最新版本的考试原题-第6题

choose three Which three statements are true about indexes and their administration in an Orade database? A) An INVISIBLE index is not maintained when Data Manipulation Language (DML) is performed on its underlying table. B) An index can be created a

【2019年8月版本】OCP 071认证考试最新版本的考试原题-第7题

Choose three Which three are true about granting object privileges on tables, views, and sequences? A) UPDATE can be granted only on tables and views. B) DELETE can be granted on tables, views, and sequences. C) REFERENCES can be granted only on tabl

【2019年8月版本】OCP 071认证考试最新版本的考试原题-第9题

Choose three Which three statements are true about views in an Orade batabase? A) A SELECT statement cannot contain a where clause when querying a view contaning a WHERE clause in its defining query B) Rows inserted into a table using a view are reta

【2019年8月版本】OCP 071认证考试最新版本的考试原题-第10题

Choose two Which two statements are true about Oracle synonyms? A) A synonym can have a synonym. B) All private synonym names must be unique in the database. C) Any user can create a PUBLIC synonym. D) A synonym can be created on an object in a packa

【2019年8月版本】OCP 071认证考试最新版本的考试原题-第11题

Choose two. Which two statements are true about a self join? A) The join key column must have an index. B) It can be a left outer join. C) It must be a full outer join. D) It can be an inner join. E) It must be an equie join. Answer:BD (自连接其实跟两张表的连接一