exam questions

Exam 1z0-082 All Questions

View all questions & answers for the 1z0-082 exam

Exam 1z0-082 topic 1 question 20 discussion

Actual exam question from Oracle's 1z0-082
Question #: 20
Topic #: 1
[All 1z0-082 Questions]

Which two statements are true about the ORDER BY clause when used with a SQL statement containing a SET operator such as UNION? (Choose two.)

  • A. Column positions must be used in the ORDER BY clause
  • B. Only column names from the first SELECT statement in the compound query are recognized
  • C. The first column in the first SELECT of the compound query with the UNION operator is used by default to sort output in the absence of an ORDER BY clause
  • D. Each SELECT statement in the compound query must have its own ORDER BY clause
  • E. Each SELECT statement in the compound query can have its own ORDER BY clause
Show Suggested Answer Hide Answer
Suggested Answer: BC 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
danito
Highly Voted 4 years, 2 months ago
B C are the corrects
upvoted 24 times
Ekos
3 years, 7 months ago
i agree
upvoted 2 times
...
ama
4 years, 1 month ago
evidence ?
upvoted 1 times
...
...
you1234
Highly Voted 4 years ago
B & C is correct answer
upvoted 5 times
ama
4 years ago
Yes!!! B and C are correct
upvoted 4 times
...
...
Abdullejr
Most Recent 6 months, 3 weeks ago
Selected Answer: BC
B and C without doubt.
upvoted 1 times
...
jagz3000
7 months, 3 weeks ago
Selected Answer: BC
i agree
upvoted 1 times
...
nautil2
10 months, 3 weeks ago
Selected Answer: BC
A - FALSE; column ord_no is part of the primary key, hence it cannot be NULL. There is no default value after sequence is dropped. When an attempt to insert a row without ord_no specified is made, an error ORA-02289 occurs. B - TRUE; if GRANT SELECT is missing, an error "ORA-00942: table or view does not exists" occurs after INSERT attempt C - TRUE; tested D - FALSE; it cycles after value 100000 is reached, so after value 100000, next value is 1 E - FALSE; sequence cycles, so when MAXVALUE is reached, duplicates can occur
upvoted 1 times
nautil2
10 months, 3 weeks ago
I am sorry, answers above belong to another question. Right answers are: A - FALSE; e.g. SELECT dept_no,ename FROM emp UNION SELECT deptno,ename FROM employees ORDER BY ename; B - TRUE; tested; not documented in SQL Reference, but works C - TRUE; tested; NULLs are last in output D - FALSE; Release 19 SQL Reference: "Also, the ORDER BY clause can appear only in the last component query. The ORDER BY clause orders all rows returned by the entire compound query." E - FALSE; see D
upvoted 1 times
...
...
Oracle2020
11 months, 2 weeks ago
The E is not correct because in the Union statement composition you add an ORDER BY clause to the last SELECT statement A is incorrect because the column composition has no reason to be used in the order by, you can use only one of the columns to sort only the first select list , if it has more than one column. B is correct because indeed the names of the columns of the first select list are those that are shown in the output of the query and are recognized C is correct So by default the correct answers are B and C
upvoted 1 times
...
zouve
1 year ago
Selected Answer: BC
BC for me
upvoted 1 times
...
auwia
1 year ago
Tip: to answer this question you should read the answers from bottom and try to find out a possible reason why E is false! :)
upvoted 1 times
...
mamadu
1 year ago
Selected Answer: BC
correct statements.
upvoted 1 times
...
auwia
1 year, 1 month ago
Selected Answer: BE
Provided answer are correct: A. Column positions must be used in the ORDER BY clause --> False, you can use column name too. B. Only column names from the first SELECT statement in the compound query are recognized --> True C. The first column in the first SELECT of the compound query with the UNION operator is used by default to sort output in the absence of an ORDER BY clause --> False, to have an order, you must use ORDER BY clause. D. Each SELECT statement in the compound query must have its own ORDER BY clause. False, ORDER BY clause is optional. E. Each SELECT statement in the compound query can have its own ORDER BY clause --> True
upvoted 1 times
mamadu
1 year ago
C = true , try querying a table without an order by, you will still get the records ordered by the first column of the table.
upvoted 1 times
auwia
1 year ago
it's just a case because probably you used few records, try with milion records maybe splitted in partitions ... maybe it's still working, but Oracle doesn't garantee you any order if you don't use the ORDER BY clause. At least you can try to find an official Oracle link saying that the sentence is True, but I don't think you'll be able to find one! :)
upvoted 1 times
...
...
...
trgbighero
1 year, 9 months ago
Selected Answer: BC
BC is correct
upvoted 1 times
...
algerianphoenix
1 year, 11 months ago
B,C Correct answers.
upvoted 1 times
...
emburria
2 years, 6 months ago
B, C are correct. It's incredible how (nearly) all the answers they give are worng
upvoted 2 times
...
ryuah
2 years, 6 months ago
B,C is correct
upvoted 1 times
...
mianjee
2 years, 11 months ago
select employee_id,last_name "Last Name" FROM employees where employee_id=101 union select employee_id EMP_NO, last_name from employees where employee_id=113; C is correct.
upvoted 1 times
...
you1234
4 years ago
Please ignore this - I want to type for other question B is wrong - you can insert if you have insert privilege on table from other schema. not required separate privileges on sequence.
upvoted 1 times
...
you1234
4 years ago
B is wrong - you can insert if you have insert privilege on table from other schema. not required separate privileges on sequence.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago