QuestionQ15

VerifiedPrepare data

HOTSPOT

You have a data warehouse containing the following tables:

  • DimCustomer
  • DimEmployee
  • DimGeography
  • FactInternetSales

Every table has a primary key and these relationships:

  • CustomerKey = FactInternetSales.CustomerKey
  • EmployeeKey = FactInternetSales.EmployeeKey
  • Geography = DimCustomer.GeographyKey

You have a T-SQL query named Query1 that contains the following statements.

Question Image

For each statement below, select Yes when the statement is true. Otherwise, select No.

Yes or No
StatementsYesNo
Query1 will return multiple rows for a single customer if the customer has placed more than one online sales order.
If a customer record in DimCustomer has a GeographyKey value that does NOT exist in DimGeography, the customer’s sales data will still appear in the Query1 results.
Adding the clause GROUP BY g.EnglishCountryRegionName to Query1 will calculate the total sales amount by country.
Explanation

Each FactInternetSales row matching a customer is returned, so multiple online orders for one customer yield multiple rows. The join to DimGeography is an INNER JOIN, so a customer whose GeographyKey has no matching geography is excluded. A country total requires an aggregate such as SUM(f.SalesAmount), and SQL Server also requires nonaggregated selected columns to be included in the GROUP BY list.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!