exam questions

Exam 1z0-082 All Questions

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

Exam 1z0-082 topic 1 question 46 discussion

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

Examine the description of the PROMOTIONS table:

You want to display the unique promotion costs in each promotion category.
Which two queries can be used? (Choose two.)

  • A. SELECT promo_cost, promo_category FROM promotions ORDER BY by 1;
  • B. SELECT DISTINCT promo_cost || ' in ' || DISTINCT promo_category FROM promotions ORDER BY 1;
  • C. SELECT DISTINCT promo_category || ' has ' || promo_cost AS COSTS FROM promotions ORDER BY 1;
  • D. SELECT promo_category, DISTINCT promo_cost FROM promotions ORDER BY 2;
  • E. SELECT DISTINCT promo_category, promo_cost FROM promotions ORDER BY 1;
Show Suggested Answer Hide Answer
Suggested Answer: CE 🗳️

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
you1234
Highly Voted 3 years, 6 months ago
C & E is correct answer
upvoted 17 times
Ekos
3 years, 1 month ago
i agree
upvoted 2 times
...
...
Sharif1
Highly Voted 3 years, 5 months ago
yes, C and E are correct.
upvoted 8 times
...
nautil2
Most Recent 2 months, 4 weeks ago
One could understand the task specification as asking to list only those categories for which the value of promo_cost was unique. That is, if several rows of promo_id, promo_category had the same promo_cost, this row was not listed. Such a task specification is noticeably more complex, it is not in the offered answers, and the corresponding SELECT would look like this: SELECT promo_category, promo_cost FROM ( SELECT promo_id, promo_name, promo_category, promo_cost, COUNT(*) OVER (PARTITION BY promo_category, promo_cost) as cost_count FROM promotions ) WHERE cost_count = 1;
upvoted 1 times
nautil2
2 months, 3 weeks ago
Or simplier: SELECT promo_category, promo_cost FROM promotions GROUP BY promo_category, promo_cost HAVING COUNT(*) = 1;
upvoted 2 times
...
...
nautil2
2 months, 4 weeks ago
Selected Answer: CE
A - false; the query returns all rows B - false; using of second DISTINCT returns an error ORA-00936 missing expression C - true; returns category name and promo_cost, where each promo_cost for given cathegory is returned only once D - false; using of DISTINCT returns an error ORA-00936 missing expression E - true; same answer as C
upvoted 1 times
...
Oracle2020
4 months, 2 weeks ago
The correct answers are D and E A is incorrect because it does not show the unique promotion costs for each promotion category B is incorrect because it is concatenating varchar and numeric data types without doing data conversion C is incorrect because it is concatenating varchar and numeric data types without doing data conversion D provides the correct data And by discarding the previous ones that are wrong, you can give the solution
upvoted 1 times
...
auwia
6 months, 1 week ago
Selected Answer: CE
The base! :-)
upvoted 1 times
...
acr23cd
10 months, 1 week ago
Selected Answer: CE
A. SELECT promo_cost, promo_category FROM promotions ORDER BY by 1; -- FALSE: No distinct B. SELECT DISTINCT promo_cost || ' in ' || DISTINCT promo_category FROM promotions ORDER BY 1; -- FALSE: Distinct just once, next to SELECT C. SELECT DISTINCT promo_category || ' has ' || promo_cost AS COSTS FROM promotions ORDER BY 1; -- TRUE D. SELECT promo_category, DISTINCT promo_cost FROM promotions ORDER BY 2; -- FALSE: Distinct just once, next to SELECT E. SELECT DISTINCT promo_category, promo_cost FROM promotions ORDER BY 1; -- TRUE
upvoted 1 times
...
Franky_T
1 year, 8 months ago
Selected Answer: CE
A is wrong. No DISTINCT clause used. B is wrong. DISTINCT can be used only once in a select clause at the beginning. C is correct. D is wrong. DISTINCT can be used only once in a select clause at the beginning. E is correct.
upvoted 1 times
...
casfdsaf
1 year, 10 months ago
Selected Answer: CE
ce right
upvoted 1 times
...
Guhborges
1 year, 11 months ago
Selected Answer: CE
c & e for sure
upvoted 1 times
...
ryuah
2 years ago
C,E is correct
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