Ultimate access to all questions.
You are working as a Fabric Analytics Engineer and are tasked with optimizing the performance of a SQL query in a Fabric lakehouse environment. The dataset contains detailed information about website page views, including the page URL, page title, and the number of views for each page. Your goal is to retrieve the top 5 most viewed pages, along with their page titles and view counts, while ensuring the query is efficient and scalable for large datasets. Which of the following SQL queries would you use to achieve this task? (Choose one option)
Explanation:
Option B is the correct choice because it accurately groups the data by page URL, which is a unique identifier for each page, ensuring that the count of views is correctly aggregated per page. The use of COUNT(*) calculates the total number of views for each page, and the results are ordered by view count in descending order to identify the most viewed pages. The 'FETCH FIRST 5 ROWS ONLY' clause efficiently limits the result set to the top 5 most viewed pages, making the query performant and scalable for large datasets. This approach is aligned with best practices for querying large datasets in a Fabric lakehouse environment.