What is the expected output?

A table (t1) contains 1000 random integer values in the first column (col1).The random
values are in the range of 0-1000.
Examine this query:
SELECT col1 FROM t1 WHERE col1 <=100 UNION
SELECT col1 FROM t1 WHERE col1 >=900 ORDER BY col1 DESC
What is the expected output?

A table (t1) contains 1000 random integer values in the first column (col1).The random
values are in the range of 0-1000.
Examine this query:
SELECT col1 FROM t1 WHERE col1 <=100 UNION
SELECT col1 FROM t1 WHERE col1 >=900 ORDER BY col1 DESC
What is the expected output?

A.
A list of all values, including duplicates, sorted in descending order in the ranges of 0-100
and 900-1000

B.
A list of all random unsorted values, including duplicates, in the range of 0-100 followed
by the list of all values, including in the range of 900-1000 sorted in descending order

C.
A list of unique random values in the range of 0-100 followed by the list of unique values
in the range of 900-1000 sorted in descending order

D.
A list of all unique values sorted in descending order within the ranges of 0-100 and 900-
1000



Leave a Reply 8

Your email address will not be published. Required fields are marked *


Ram

Ram

The correct answer is A

Manisha

Manisha

I agree correct answer is D.

Ray

Ray

D is correct.

rain

rain

but why the final order is desc?

alpha

alpha

why not C with DESC sorting?