
Ultimate access to all questions.
You are tasked with creating a function in your lakehouse that calculates the average sales per day. Describe the steps you would take to create this function, including the use of parameters and the benefits of using a function over a direct SQL query.
A
Write a direct SQL query to calculate the average sales per day.
B
Create a function with parameters to calculate the average sales per day, simplifies repeated queries and ensures consistent calculations.
C
Create a function without using parameters.
D
Create a function that only calculates the total sales.