exam questions

Exam DP-203 All Questions

View all questions & answers for the DP-203 exam

Exam DP-203 topic 2 question 93 discussion

Actual exam question from Microsoft's DP-203
Question #: 93
Topic #: 2
[All DP-203 Questions]

DRAG DROP
-

You have an Azure subscription that contains an Azure Databricks workspace. The workspace contains a notebook named Notebook1.

In Notebook1, you create an Apache Spark DataFrame named df_sales that contains the following columns:

• Customer
• SalesPerson
• Region
• Amount

You need to identify the three top performing salespersons by amount for a region named HQ.

How should you complete the query? To answer, drag the appropriate values to the correct targets. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

NOTE: Each correct selection is worth one point.

Show Suggested Answer Hide Answer
Suggested Answer:

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
esaade
Highly Voted 1 year, 8 months ago
df_sales.filter(col("Region") == "HQ") .groupBy(col('SalesPerson')) .agg(sum('Amount').alias('TotalAmount')) .orderBy(desc('TotalAmount')) .limit(3)
upvoted 17 times
...
kkk5566
Highly Voted 1 year, 3 months ago
.groupBy(col('SalesPerson')) and .orderBy(desc('TotalAmount'))
upvoted 5 times
...
sachin_mt
Most Recent 2 months, 2 weeks ago
The syntax for orderBy function should be orderBy(col('TotalAmount').desc())
upvoted 1 times
...
Alongi
10 months ago
The answer is correct!
upvoted 1 times
...
aurorafang
1 year, 10 months ago
for the sequence, group by usually put before the order by operations
upvoted 5 times
...
[Removed]
1 year, 10 months ago
correct
upvoted 3 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 ...