Exam Preparation Quiz

Question 21 of 75

Complete the T-SQL Query for Holiday Sales

You have a Fabric lakehouse named Lakehouse1 that contains the following data.

Table nameColumn nameData type
dbo.publicholidaysCountryOrReqionVarchar(8000)
dbo.publicholidaysHolidayNameVarchar(8000)
dbo.publicholidaysDateDate
dbo.salesOrderDateDate
dbo.salesQuantityFloat
dbo.salesUnitPriceFloat

You need build a T-SQL statement that will return the total sales amount by OrderDate only for the days that are holidays in Australia. The total sales amount must sum the quantity multiplied by the price on each row in the dbo.sales table.

You have the following T-SQL query:

SELECT s.OrderDate, 
______________ AS TotalSalesAmt
FROM [Lakehouse1].[dbo].[sales] AS s
INNER JOIN [Lakehouse1].[dbo].[publicholidays] AS ph ON s.OrderDate = ph.Date
WHERE ph.CountryOrRegion = 'Australia'
GROUP BY s.OrderDate

How should you complete the statement?

Choose the correct answer from the options below.

Explanations for each answer:

Learn more about the SUM aggregate function:
SUM Function
Next Question