What does the following calculate? SELECT month, revenue, revenue – LAG(revenue) OVER (ORDER BY month) AS mom_change FROM sales SQL Data AnalystMedium Try Now
What does the following query pattern detect? SELECT * FROM orders o WHERE NOT EXISTS (SELECT 1 FROM returns r WHERE r.order_id = o.order_id) SQL Data AnalystMedium Try Now
What does the GROUPING() function return when used with ROLLUP or CUBE? SQL Data AnalystMedium Try Now
In what scenario does an INNER JOIN produce the same result as a LEFT JOIN? SQL Data AnalystMedium Try Now
What does the NTILE(4) OVER (ORDER BY score DESC) assign to a row ranked 3rd out of 20? SQL Data AnalystMedium Try Now
What does the FIRST_VALUE(revenue) OVER (PARTITION BY region ORDER BY sale_date) return? SQL Data AnalystMedium Try Now
What does a SCD Type 2 (Slowly Changing Dimension) do to preserve history? SQL Data AnalystMedium Try Now
What does the following query calculate? SELECT product, sales / SUM(sales) OVER () * 100 AS pct FROM sales_table SQL Data AnalystMedium Try Now
How does a star schema differ from a snowflake schema in data warehousing? SQL Data AnalystMedium Try Now
What is the difference between ROWS BETWEEN and RANGE BETWEEN in window frame clauses? SQL Data AnalystMedium Try Now
What does the LEAD(revenue, 1) OVER (ORDER BY month) window function return? SQL Data AnalystMedium Try Now
What does PERCENT_RANK() return for the first row in a partition ordered by salary? SQL Data AnalystMedium Try Now
What is the difference between a correlated subquery and a non-correlated subquery? SQL Data AnalystMedium Try Now