
Ultimate access to all questions.
As a Microsoft Fabric Analytics Engineer Associate, you are tasked with analyzing website traffic data stored in a Fabric lakehouse. The dataset includes columns for the visitor's IP address, the page they visited, and the time spent on the page. Your goal is to write a SQL query that calculates the average time spent on each page by visitors from a specific IP address, '192.168.1.1', and includes the page name in the results. Consider the following constraints: the solution must efficiently handle large datasets, comply with data privacy standards by not exposing individual visitor data, and be optimized for performance. Which of the following SQL queries meets all these requirements? (Choose one option.)
A
SELECT PageName, AVG(TimeSpent) AS AvgTimeSpent FROM WebsiteTraffic WHERE IPAddress = '192.168.1.1' GROUP BY PageName;
B
SELECT PageName, SUM(TimeSpent) / COUNT() AS AvgTimeSpent FROM WebsiteTraffic WHERE IPAddress = '192.168.1.1' GROUP BY PageName;
C
SELECT PageName, AVG(TimeSpent) AS AvgTimeSpent FROM WebsiteTraffic GROUP BY PageName HAVING IPAddress = '192.168.1.1';
D
SELECT PageName, SUM(TimeSpent) / COUNT(DISTINCT IPAddress) AS AvgTimeSpent FROM WebsiteTraffic WHERE IPAddress = '192.168.1.1' GROUP BY PageName;