
Answer-first summary for fast verification
Answer: Use a window function with an OVER clause.
A. Incorrect. An aggregate function gives you one result for all the rows. B. Incorrect. Using a UDF function entails extra work; therefore, it is not the most efficient solution. C. Incorrect. BigQuery ML does not have any inbuilt features that provide this functionality. D. Correct. A window function defines rows around each row. As a result, this approach can produce a separate output for each row.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You have analytics data stored in BigQuery. You need an efficient way to compute values across a group of rows and return a single result for each row.
A
Use an aggregate function.
B
Use a UDF (user-defined function).
C
Use BigQuery ML.
D
Use a window function with an OVER clause.
No comments yet.