exam questions

Exam 1z0-061 All Questions

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

Exam 1z0-061 topic 4 question 56 discussion

Actual exam question from Oracle's 1z0-061
Question #: 56
Topic #: 4
[All 1z0-061 Questions]

View the Exhibit and examine the data in the PROMO_CATEGORY and PROMO_COST columns of the PROMOTIONS table.

Evaluate the following two queries:
SQL>SELECT DISTINCT promo_category to_char(promo_cost)"code"

FROM promotions -
ORDER BY code;
SQL>SELECT DISTINCT promo_category promo_cost "code"

FROM promotions -
ORDER BY 1;
Which statement is true regarding the execution of the above queries?

  • A. Only the first query executes successfully.
  • B. Only the second query executes successfully.
  • C. Both queries execute successfully but give different results.
  • D. Both queries execute successfully and give the same result.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
Note: You cannot use column alias in the WHERE clause.

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
winston
1 year, 5 months ago
wrong answer, both queries execute suceessfully but bive different results, first query sorts the numeric strings in lexicographic order
upvoted 1 times
...
Sugar
5 years, 5 months ago
B is correct. no doubt
upvoted 1 times
duongvietnam
5 years, 3 months ago
u sure ? tell me why ?
upvoted 1 times
newtonlight
4 years ago
order by clause use alias,beacuse alias default is upper, the double quote can change the action,so fisrt SQL make syntax error
upvoted 1 times
...
...
...
duongvietnam
5 years, 5 months ago
An alias can be used in a query select list to give a column a different name. You can use the alias in GROUP BY, ORDER BY, or HAVING clauses to refer to the column.
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