BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Databricks Exam Databricks-Certified-Data-Analyst-Associate Topic 3 Question 28 Discussion

Actual exam question for Databricks's Databricks-Certified-Data-Analyst-Associate exam
Question #: 28
Topic #: 3
[All Databricks-Certified-Data-Analyst-Associate Questions]

A data analyst has created a user-defined function using the following line of code:

CREATE FUNCTION price(spend DOUBLE, units DOUBLE)

RETURNS DOUBLE

RETURN spend / units;

Which of the following code blocks can be used to apply this function to the customer_spend and customer_units columns of the table customer_summary to create column customer_price?

Show Suggested Answer Hide Answer

Contribute your Thoughts:

Mirta
11 days ago
D is interesting, but I don't think we need to explicitly cast the result as a double. E is the clearest choice in my opinion.
upvoted 0 times
...
Carrol
15 days ago
I agree with Graciela, option E looks like the right choice because it directly applies the function to the columns.
upvoted 0 times
...
Bok
16 days ago
Hmm, I'm not sure about option C. Wrapping the function call in another function call seems unnecessary.
upvoted 0 times
Thea
3 days ago
E) SELECT price(customer_spend, customer_units) AS customer_price FROM customer_summary
upvoted 0 times
...
Luz
5 days ago
A) SELECT PRICE customer_spend, customer_units AS customer_price FROM customer_summary
upvoted 0 times
...
...
Fallon
19 days ago
Option E looks good to me. Applying the custom function directly to the columns is the straightforward way to do it.
upvoted 0 times
Tijuana
1 days ago
I think option E is the correct choice as well. It makes sense to use the function directly on the columns.
upvoted 0 times
...
Stefania
12 days ago
Option E looks good to me. Applying the custom function directly to the columns is the straightforward way to do it.
upvoted 0 times
...
...
Graciela
27 days ago
I think the correct answer is E.
upvoted 0 times
...

Save Cancel