exam questions

Exam 1z0-071 All Questions

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

Exam 1z0-071 topic 1 question 1 discussion

Actual exam question from Oracle's 1z0-071
Question #: 1
Topic #: 1
[All 1z0-071 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 DISTINCT promo_category || ' has ' || promo_cost AS COSTS FROM promotions ORDER BY 1;
  • B. SELECT DISTINCT promo_cost || ' in ' || DISTINCT promo_category FROM promotions ORDER BY 1;
  • C. SELECT DISTINCT promo_category, promo_cost FROM promotions ORDER BY 1;
  • D. SELECT promo_category DISTINCT promo_cost, FROM promotions ORDER BY 2;
  • E. SELECT promo_cost, promo_category FROM promotions ORDER BY 1;
Show Suggested Answer Hide Answer
Suggested Answer: AC 🗳️

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
5cff9a8
2 months ago
A and C is the correct answer.
upvoted 1 times
...
Drexan
2 months, 1 week ago
Selected Answer: AC
Correct answers
upvoted 1 times
...
fuck_india
7 months, 1 week ago
Selected Answer: AC
A and C are correct.
upvoted 1 times
...
alelejaja
7 months, 2 weeks ago
Selected Answer: AC
Agree that right answers are A and C
upvoted 1 times
...
Stevenciu
9 months, 2 weeks ago
Selected Answer: AC
Agree that right answers are A and C
upvoted 1 times
...
Lee_jong_suk
1 year ago
Selected Answer: AC
Distinct is used to get distinct set of values for one or more columns mentioned in select statement
upvoted 2 times
...
KizTine
1 year, 3 months ago
Selected Answer: AC
The correct answers
upvoted 1 times
...
tradersmj1
1 year, 7 months ago
Selected Answer: AC
AC are correct
upvoted 1 times
...
Oracle_373
1 year, 7 months ago
-- Distinct keyword is used to select the unique values of the column/combination of columns mentioned after the DISTINCT clause. Thus Option E is incorrect , as this does not use DISTINCT clause and might include duplicates. -- Distinct should be used once in a SELECT statement and should be used IMMEDIATELY after the SELECT clause. NOT to be used before every column. Thus Options D and B are incorrect, as the positioning of the DISTINCT clause is incorrect. -- Option A and C are correct. Option A: Even though there is a string ' has ' in everyrow returned , the combination of promo_category || ' has ' || promo_cost will still be distinct. Option C: correct use case. ORDER BY clause does not affect the uniqueness in the returned result set.
upvoted 4 times
...
alic_alex
1 year, 10 months ago
Selected Answer: AC
AC are correct. DB have Distinct in a wrong position in the query and E returns all because of the missing DISTINCT
upvoted 2 times
...
subtype11
1 year, 11 months ago
Option A is not correct because the query uses the "||" operator to concatenate the promo_category and promo_cost columns with a string ' has ' in between. This creates a new column "COSTS" that combines the values from the two columns in a way that is not useful for the task of displaying unique promotion costs in each promotion category. The SELECT DISTINCT statement is used on this combined column, so it will return unique values for the concatenated column, but it does not address the requirement of showing unique promotion costs in each promotion category. Additionally, it uses an ORDER BY 1 which in this case doesn't make sense since the column COSTS doesn't exist.
upvoted 1 times
J4vi
1 year, 8 months ago
I tried all the options.The ORDER BY still works in this concatenations and the table shows what its required
upvoted 2 times
...
...
elchiko
2 years, 1 month ago
distinct must come soon after the select keyword and only one per select statement
upvoted 1 times
...
Rik92
2 years, 2 months ago
AC are correct. DB have Distinct in a wrong position in the query and E returns all because of the missing DISTINCT
upvoted 2 times
...
Artur1991
2 years, 4 months ago
ac are correct answers
upvoted 2 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