Ultimate access to all questions.
You are working as a Fabric Analytics Engineer and have been tasked with analyzing customer feedback data stored in a Fabric lakehouse. The dataset includes customer ID, feedback rating, and feedback text. Your goal is to write a SQL query that calculates the average feedback rating across all customers and counts how many unique customers have provided feedback. The solution must ensure accuracy in counting only distinct customers to avoid duplicates. Which of the following SQL queries meets these requirements? (Choose one correct option)
Explanation:
Option B is correct because it accurately calculates the average feedback rating using the AVG() function and counts the number of unique customers who provided feedback by using COUNT(DISTINCT CustomerID). This ensures that each customer is only counted once, even if they provided multiple feedback entries. Options A and C do not account for duplicate customer IDs, and option D incorrectly counts distinct feedback texts instead of customers.