New Year Sale ! 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:

Mona
23 days ago
I'd go with E. Keeping it simple and direct is usually the best approach in these exams.
upvoted 0 times
...
Ronald
27 days ago
Haha, option B is just asking for the function itself, not applying it to the data. Classic trick question!
upvoted 0 times
Stephaine
6 days ago
E) SELECT price(customer_spend, customer_units) AS customer_price FROM customer_summary
upvoted 0 times
...
Callie
15 days ago
A) SELECT PRICE customer_spend, customer_units AS customer_price FROM customer_summary
upvoted 0 times
...
...
Mirta
2 months 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
2 months 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
2 months ago
Hmm, I'm not sure about option C. Wrapping the function call in another function call seems unnecessary.
upvoted 0 times
Clay
9 days ago
Yes, I agree. Option E is the most straightforward way to apply the user-defined function.
upvoted 0 times
...
Stephaine
17 days ago
I think option E is the correct one.
upvoted 0 times
...
Thea
1 months ago
E) SELECT price(customer_spend, customer_units) AS customer_price FROM customer_summary
upvoted 0 times
...
Luz
1 months ago
A) SELECT PRICE customer_spend, customer_units AS customer_price FROM customer_summary
upvoted 0 times
...
...
Fallon
2 months 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
Tennie
27 days ago
Yes, option E seems like the right answer. It's clear and concise to use the function on the specified columns.
upvoted 0 times
...
Lilli
1 months ago
I agree, option E is the most logical choice here. It's the simplest way to apply the user-defined function.
upvoted 0 times
...
Tijuana
1 months 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
2 months 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
2 months ago
I think the correct answer is E.
upvoted 0 times
...

Save Cancel