Windows 12m
SQL 1: Second Highest Salary
Solve this SQL interview task using the seeded tables: Second Highest Salary. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Windows 12m
SQL 2: Nth Highest Salary
Return the third highest distinct salary from employees. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Windows 12m
SQL 3: Top 3 Salaries per Department
Solve this SQL interview task using the seeded tables: Top 3 Salaries per Department. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Windows 12m
SQL 4: Latest Order per Customer
Solve this SQL interview task using the seeded tables: Latest Order per Customer. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Windows 12m
SQL 5: First and Last Order per Customer
Solve this SQL interview task using the seeded tables: First and Last Order per Customer. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Windows 12m
SQL 6: Running Total by Date
Solve this SQL interview task using the seeded tables: Running Total by Date. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Windows 12m
SQL 7: 3-Day Moving Average
Solve this SQL interview task using the seeded tables: 3-Day Moving Average. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Windows 12m
SQL 8: Month-over-Month Growth
Solve this SQL interview task using the seeded tables: Month-over-Month Growth. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Windows 12m
SQL 9: Rank Cities by Sales with Ties
Solve this SQL interview task using the seeded tables: Rank Cities by Sales with Ties. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Windows 12m
SQL 10: Top 10 Percent of Customers by Spend
Solve this SQL interview task using the seeded tables: Top 10 Percent of Customers by Spend. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Joins 12m
SQL 11: Customers with No Orders
Solve this SQL interview task using the seeded tables: Customers with No Orders. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Joins 12m
SQL 12: Employees Earning Above Department Average
Solve this SQL interview task using the seeded tables: Employees Earning Above Department Average. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Joins 12m
SQL 13: Orders with Missing Customer Records
Solve this SQL interview task using the seeded tables: Orders with Missing Customer Records. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Joins 12m
SQL 14: Intersection of Active Users Across Two Months
Solve this SQL interview task using the seeded tables: Intersection of Active Users Across Two Months. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Joins 12m
SQL 15: Customers Who Bought Every Product in a Category
Solve this SQL interview task using the seeded tables: Customers Who Bought Every Product in a Category. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Joins 18m
SQL 16: Compare Two Tables and Find Added Rows
Solve this SQL interview task using the seeded tables: Compare Two Tables and Find Added Rows. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Joins 18m
SQL 17: Same-Day Repeat Orders
Solve this SQL interview task using the seeded tables: Same-Day Repeat Orders. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Joins 18m
SQL 18: Orders and Their Immediate Previous Order
Solve this SQL interview task using the seeded tables: Orders and Their Immediate Previous Order. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Joins 18m
SQL 19: Find Duplicate Business Keys
Solve this SQL interview task using the seeded tables: Find Duplicate Business Keys. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Joins 18m
SQL 20: Customers with Orders in Consecutive Months
Solve this SQL interview task using the seeded tables: Customers with Orders in Consecutive Months. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Advanced SQL 18m
SQL 21: Recursive Employee Hierarchy
Solve this SQL interview task using the seeded tables: Recursive Employee Hierarchy. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Advanced SQL 18m
SQL 22: Hierarchy Path from CEO to Employee
Solve this SQL interview task using the seeded tables: Hierarchy Path from CEO to Employee. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Advanced SQL 18m
SQL 23: Sessionization with a 30-Minute Gap
Solve this SQL interview task using the seeded tables: Sessionization with a 30-Minute Gap. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Advanced SQL 18m
SQL 24: Rolling 7-Day Active Users
Solve this SQL interview task using the seeded tables: Rolling 7-Day Active Users. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Advanced SQL 18m
SQL 25: Customers Who Churned (No Orders in Last 90 Days)
Solve this SQL interview task using the seeded tables: Customers Who Churned (No Orders in Last 90 Days). Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Advanced SQL 18m
SQL 26: Repeat Purchase Within 7 Days
Solve this SQL interview task using the seeded tables: Repeat Purchase Within 7 Days. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Advanced SQL 18m
SQL 27: Consecutive Login Streaks
Solve this SQL interview task using the seeded tables: Consecutive Login Streaks. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Advanced SQL 18m
SQL 28: Gap Greater Than 30 Days Between Orders
Solve this SQL interview task using the seeded tables: Gap Greater Than 30 Days Between Orders. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Advanced SQL 18m
SQL 29: Median Salary
Solve this SQL interview task using the seeded tables: Median Salary. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Advanced SQL 18m
SQL 30: Pareto 80 Percent Customers
Solve this SQL interview task using the seeded tables: Pareto 80 Percent Customers. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Warehouse 18m
SQL 31: Deduplicate and Keep the Latest Record per Business Key
Solve this SQL interview task using the seeded tables: Deduplicate and Keep the Latest Record per Business Key. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Warehouse 18m
SQL 32: SCD Type 2 - Find Changed Customer Rows
Solve this SQL interview task using the seeded tables: SCD Type 2 - Find Changed Customer Rows. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Warehouse 18m
SQL 33: SCD Type 2 - Close Old Row and Insert New Row
Solve this SQL interview task using the seeded tables: SCD Type 2 - Close Old Row and Insert New Row. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Warehouse 18m
SQL 34: Incremental Load Using Watermark
Solve this SQL interview task using the seeded tables: Incremental Load Using Watermark. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Warehouse 18m
SQL 35: Merge Staging into Target by Business Key
Solve this SQL interview task using the seeded tables: Merge Staging into Target by Business Key. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Warehouse 18m
SQL 36: Snapshot Table - Latest Balance per Account
Solve this SQL interview task using the seeded tables: Snapshot Table - Latest Balance per Account. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Warehouse 18m
SQL 37: Late-Arriving Facts That Missed the Correct Date Partition
Solve this SQL interview task using the seeded tables: Late-Arriving Facts That Missed the Correct Date Partition. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Warehouse 18m
SQL 38: Find Changed Rows Between Two Snapshots by Key
Solve this SQL interview task using the seeded tables: Find Changed Rows Between Two Snapshots by Key. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Warehouse 18m
SQL 39: Fact Table Missing Dimension Keys by Load Date
Solve this SQL interview task using the seeded tables: Fact Table Missing Dimension Keys by Load Date. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Warehouse 18m
SQL 40: Current Active SCD Row per Customer
Solve this SQL interview task using the seeded tables: Current Active SCD Row per Customer. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Performance 18m
SQL 41: Rewrite a Correlated Subquery to a Join
Solve this SQL interview task using the seeded tables: Rewrite a Correlated Subquery to a Join. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Performance 18m
SQL 42: Replace NOT IN with NOT EXISTS Safely
Solve this SQL interview task using the seeded tables: Replace NOT IN with NOT EXISTS Safely. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Performance 18m
SQL 43: Latest Row - Self Join versus Window Function
Solve this SQL interview task using the seeded tables: Latest Row - Self Join versus Window Function. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Performance 18m
SQL 44: Filter Early Before Join
Solve this SQL interview task using the seeded tables: Filter Early Before Join. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Performance 18m
SQL 45: Partition-Pruning Friendly Date Filter
Solve this SQL interview task using the seeded tables: Partition-Pruning Friendly Date Filter. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Performance 18m
SQL 46: Conditional Aggregation for Status Counts
Solve this SQL interview task using the seeded tables: Conditional Aggregation for Status Counts. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Performance 18m
SQL 47: Pivot Revenue by Region Using CASE
Solve this SQL interview task using the seeded tables: Pivot Revenue by Region Using CASE. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Performance 18m
SQL 48: GROUPING SETS / ROLLUP Style Subtotals
Solve this SQL interview task using the seeded tables: GROUPING SETS / ROLLUP Style Subtotals. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Performance 18m
SQL 49: Null-Safe Comparison in Change Detection
Solve this SQL interview task using the seeded tables: Null-Safe Comparison in Change Detection. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
Performance 18m
SQL 50: Delete Duplicates and Keep the Smallest ID
Solve this SQL interview task using the seeded tables: Delete Duplicates and Keep the Smallest ID. Your solution should work for the visible sample data and for hidden edge-case datasets that test ties, NULLs, duplicate rows, missing keys, and boundary conditions where relevant.
SQL Coverage Pack 12m
CRM Profile Backfill Coverage: Profile Enrichment Join 001
Return all customers with their profile city when available. Customers without a profile should still appear with NULL city. The important part is coverage: the output must preserve every base customer row even when enrichment data is missing. This is a common production issue when optional dimension/profile tables arrive late.
SQL Coverage Pack 18m
Compensation Dashboard Tie Handling: Workforce Ranking 002
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Team Pay Ranking Reconciliation: Workforce Ranking 003
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Manager Org Salary Snapshot: Workforce Ranking 004
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 16m
Current Inventory Mart Rebuild: Warehouse Grain Reconciliation 005
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Payroll Top-Band Audit: Workforce Ranking 006
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 12m
CRM Email Duplicate Cleanup: Case-Normalized Duplicate Detection 007
Find duplicated email addresses after normalizing email casing. Ignore rows where email is NULL. The important part is normalization before grouping. Production duplicates often hide behind casing, whitespace, or NULL values, so the query must count the same key the business system treats as identical.
SQL Coverage Pack 14m
Completed-Order Coverage Gap: First Activity Retention 008
Find customers who do not have any completed order. The query should be safe even when the orders table contains NULL customer_id values. The important part is NULL-safe exclusion. In production pipelines, failed events and guest checkouts often create NULL foreign keys that can break NOT IN logic.
SQL Coverage Pack 18m
Team Pay Ranking Reconciliation: Workforce Ranking 009
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Manager Org Salary Snapshot: Workforce Ranking 010
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 12m
Contact Identity Collision Report: Case-Normalized Duplicate Detection 011
Find duplicated email addresses after normalizing email casing. Ignore rows where email is NULL. The important part is normalization before grouping. Production duplicates often hide behind casing, whitespace, or NULL values, so the query must count the same key the business system treats as identical.
SQL Coverage Pack 16m
Operations Temperature Drift Audit: Operations SLA Metric 012
Return dates where the warehouse temperature is higher than the previous day in the sample feed. The important part is comparing a row with the previous row in time order. A static threshold is not enough when the business asks for day-over-day movement.
SQL Coverage Pack 12m
Same-Day Delivery SLA Metric: Operations SLA Metric 013
Calculate the percentage of delivery records where order_date equals delivered_date. The important part is building the exact SLA numerator and denominator. Counting rows alone is not a rate, and date equality must be checked per delivery.
SQL Coverage Pack 18m
First Activity Return Check: First Activity Retention 014
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
Activation Cohort Follow-up: First Activity Retention 015
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
User Day-One Retention Audit: First Activity Retention 016
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
App Event Retention Rebuild: First Activity Retention 017
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
Payroll Top-Band Audit: Workforce Ranking 018
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Department Salary Band Leaderboard: Workforce Ranking 019
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 16m
Warehouse Product Availability: Warehouse Grain Reconciliation 020
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Bin-Level Stock Rollup: Warehouse Grain Reconciliation 021
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Manager Org Salary Snapshot: Workforce Ranking 022
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 15m
Marketing Event Metric Fix: Conditional Engagement Metric 023
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 18m
Payroll Top-Band Audit: Workforce Ranking 024
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Department Salary Band Leaderboard: Workforce Ranking 025
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Cancelled Order Leakage Check: Completed-Order Revenue 026
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 15m
Finance Threshold Reconciliation: Signed Finance Ledger 027
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 18m
E-commerce Item Revenue Rebuild: Completed-Order Revenue 028
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 10m
Regional Enablement Filter: Reference Dimension Filter 029
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 12m
Unique Student Rollup Drill: Distinct Enrollment Threshold 030
Find classes with at least five distinct enrolled students. The important part is counting unique students, not enrollment events. Retry events or duplicate rows should not inflate class capacity numbers.
SQL Coverage Pack 15m
Ad CTR Metric Rebuild: Conditional Engagement Metric 031
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 16m
Warehouse Product Availability: Warehouse Grain Reconciliation 032
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 10m
Country Threshold Logic Fix: Reference Dimension Filter 033
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 16m
Zero-Stock Snapshot Reconciliation: Warehouse Grain Reconciliation 034
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Founder Dashboard Revenue Fix: Completed-Order Revenue 035
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 16m
Warehouse Availability Guardrail: Warehouse Grain Reconciliation 036
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Inventory Snapshot Grain Fix: Warehouse Grain Reconciliation 037
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Warehouse Product Availability: Warehouse Grain Reconciliation 038
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Bin-Level Stock Rollup: Warehouse Grain Reconciliation 039
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 10m
OR Rule Reporting Drill: Reference Dimension Filter 040
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 18m
HR Leaderboard Window Function: Workforce Ranking 041
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 12m
Unique Student Rollup Drill: Distinct Enrollment Threshold 042
Find classes with at least five distinct enrolled students. The important part is counting unique students, not enrollment events. Retry events or duplicate rows should not inflate class capacity numbers.
SQL Coverage Pack 16m
Inventory Snapshot Grain Fix: Warehouse Grain Reconciliation 043
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 10m
Reference Dimension Filter Audit: Reference Dimension Filter 044
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 16m
Bin-Level Stock Rollup: Warehouse Grain Reconciliation 045
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Manager Org Salary Snapshot: Workforce Ranking 046
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Founder Dashboard Revenue Fix: Completed-Order Revenue 047
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 15m
Zero-Impression CTR Guardrail: Conditional Engagement Metric 048
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 18m
Completed-Order Revenue Mart: Completed-Order Revenue 049
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Cancelled Order Leakage Check: Completed-Order Revenue 050
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Product Revenue Grain Audit: Completed-Order Revenue 051
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Manager Org Salary Snapshot: Workforce Ranking 052
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
HR Leaderboard Window Function: Workforce Ranking 053
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Payroll Top-Band Audit: Workforce Ranking 054
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Completed-Order Revenue Mart: Completed-Order Revenue 055
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Cancelled Order Leakage Check: Completed-Order Revenue 056
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Product Revenue Grain Audit: Completed-Order Revenue 057
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
User Day-One Retention Audit: First Activity Retention 058
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 16m
Current Inventory Mart Rebuild: Warehouse Grain Reconciliation 059
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 10m
Dimension Qualification Extract: Reference Dimension Filter 060
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 12m
Distinct Enrollment Threshold: Distinct Enrollment Threshold 061
Find classes with at least five distinct enrolled students. The important part is counting unique students, not enrollment events. Retry events or duplicate rows should not inflate class capacity numbers.
SQL Coverage Pack 15m
Campaign Click-Through Audit: Conditional Engagement Metric 062
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 12m
Delivery Date Quality Audit: Operations SLA Metric 063
Calculate the percentage of delivery records where order_date equals delivered_date. The important part is building the exact SLA numerator and denominator. Counting rows alone is not a rate, and date equality must be checked per delivery.
SQL Coverage Pack 18m
E-commerce Item Revenue Rebuild: Completed-Order Revenue 064
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 15m
Marketing Event Metric Fix: Conditional Engagement Metric 065
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 18m
New User Return Signal: First Activity Retention 066
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
Next-Day Product Retention: First Activity Retention 067
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 15m
Campaign Click-Through Audit: Conditional Engagement Metric 068
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 15m
Impression Denominator Check: Conditional Engagement Metric 069
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 18m
E-commerce Item Revenue Rebuild: Completed-Order Revenue 070
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Founder Dashboard Revenue Fix: Completed-Order Revenue 071
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Order Status Revenue Guardrail: Completed-Order Revenue 072
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 12m
Same-Day Delivery SLA Metric: Operations SLA Metric 073
Calculate the percentage of delivery records where order_date equals delivered_date. The important part is building the exact SLA numerator and denominator. Counting rows alone is not a rate, and date equality must be checked per delivery.
SQL Coverage Pack 12m
Logistics Promise Reconciliation: Operations SLA Metric 074
Calculate the percentage of delivery records where order_date equals delivered_date. The important part is building the exact SLA numerator and denominator. Counting rows alone is not a rate, and date equality must be checked per delivery.
SQL Coverage Pack 18m
Team Pay Ranking Reconciliation: Workforce Ranking 075
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 15m
Account Movement Exception Report: Signed Finance Ledger 076
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 16m
Current Inventory Mart Rebuild: Warehouse Grain Reconciliation 077
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 12m
Shipment Timeliness Metric: Operations SLA Metric 078
Calculate the percentage of delivery records where order_date equals delivered_date. The important part is building the exact SLA numerator and denominator. Counting rows alone is not a rate, and date equality must be checked per delivery.
SQL Coverage Pack 16m
Inventory Snapshot Grain Fix: Warehouse Grain Reconciliation 079
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 15m
Campaign Click-Through Audit: Conditional Engagement Metric 080
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 18m
Team Pay Ranking Reconciliation: Workforce Ranking 081
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 16m
Zero-Stock Snapshot Reconciliation: Warehouse Grain Reconciliation 082
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 15m
Marketing Event Metric Fix: Conditional Engagement Metric 083
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 18m
Order Status Revenue Guardrail: Completed-Order Revenue 084
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 16m
Inventory Snapshot Grain Fix: Warehouse Grain Reconciliation 085
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Compensation Dashboard Tie Handling: Workforce Ranking 086
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 12m
Student Count Retry Guardrail: Distinct Enrollment Threshold 087
Find classes with at least five distinct enrolled students. The important part is counting unique students, not enrollment events. Retry events or duplicate rows should not inflate class capacity numbers.
SQL Coverage Pack 16m
Zero-Stock Snapshot Reconciliation: Warehouse Grain Reconciliation 088
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Daily Sensor Movement Report: Operations SLA Metric 089
Return dates where the warehouse temperature is higher than the previous day in the sample feed. The important part is comparing a row with the previous row in time order. A static threshold is not enough when the business asks for day-over-day movement.
SQL Coverage Pack 18m
Payroll Top-Band Audit: Workforce Ranking 090
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 16m
Inventory Snapshot Grain Fix: Warehouse Grain Reconciliation 091
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 12m
Logistics Promise Reconciliation: Operations SLA Metric 092
Calculate the percentage of delivery records where order_date equals delivered_date. The important part is building the exact SLA numerator and denominator. Counting rows alone is not a rate, and date equality must be checked per delivery.
SQL Coverage Pack 15m
Impression Denominator Check: Conditional Engagement Metric 093
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 18m
E-commerce Item Revenue Rebuild: Completed-Order Revenue 094
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 15m
Monthly Ledger Direction Check: Signed Finance Ledger 095
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 10m
Dimension Qualification Extract: Reference Dimension Filter 096
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 18m
Department Salary Band Leaderboard: Workforce Ranking 097
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
First Activity Return Check: First Activity Retention 098
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
Product Revenue Grain Audit: Completed-Order Revenue 099
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 16m
Zero-Stock Snapshot Reconciliation: Warehouse Grain Reconciliation 100
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
HR Leaderboard Window Function: Workforce Ranking 101
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Order Status Revenue Guardrail: Completed-Order Revenue 102
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 15m
Signed Ledger Balance Movement: Signed Finance Ledger 103
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 18m
Cancelled Order Leakage Check: Completed-Order Revenue 104
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 12m
Delivery Date Quality Audit: Operations SLA Metric 105
Calculate the percentage of delivery records where order_date equals delivered_date. The important part is building the exact SLA numerator and denominator. Counting rows alone is not a rate, and date equality must be checked per delivery.
SQL Coverage Pack 12m
Class Enrollment Quality Report: Distinct Enrollment Threshold 106
Find classes with at least five distinct enrolled students. The important part is counting unique students, not enrollment events. Retry events or duplicate rows should not inflate class capacity numbers.
SQL Coverage Pack 15m
Monthly Ledger Direction Check: Signed Finance Ledger 107
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 18m
New User Return Signal: First Activity Retention 108
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 16m
Inventory Snapshot Grain Fix: Warehouse Grain Reconciliation 109
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Warehouse Product Availability: Warehouse Grain Reconciliation 110
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Activation Cohort Follow-up: First Activity Retention 111
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 16m
Zero-Stock Snapshot Reconciliation: Warehouse Grain Reconciliation 112
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Current Inventory Mart Rebuild: Warehouse Grain Reconciliation 113
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Order Status Revenue Guardrail: Completed-Order Revenue 114
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Completed-Order Revenue Mart: Completed-Order Revenue 115
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 10m
Reference Dimension Filter Audit: Reference Dimension Filter 116
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 15m
Finance Threshold Reconciliation: Signed Finance Ledger 117
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 18m
E-commerce Item Revenue Rebuild: Completed-Order Revenue 118
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 12m
Contact Identity Collision Report: Case-Normalized Duplicate Detection 119
Find duplicated email addresses after normalizing email casing. Ignore rows where email is NULL. The important part is normalization before grouping. Production duplicates often hide behind casing, whitespace, or NULL values, so the query must count the same key the business system treats as identical.
SQL Coverage Pack 16m
Warehouse Availability Guardrail: Warehouse Grain Reconciliation 120
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Completed-Order Revenue Mart: Completed-Order Revenue 121
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Cancelled Order Leakage Check: Completed-Order Revenue 122
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Product Revenue Grain Audit: Completed-Order Revenue 123
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 15m
Account Movement Exception Report: Signed Finance Ledger 124
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 18m
Founder Dashboard Revenue Fix: Completed-Order Revenue 125
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Payroll Top-Band Audit: Workforce Ranking 126
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 15m
Signed Ledger Balance Movement: Signed Finance Ledger 127
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 15m
Debit Credit Netting Drill: Signed Finance Ledger 128
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 18m
Product Revenue Grain Audit: Completed-Order Revenue 129
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 14m
No-Purchase Customer Segment: First Activity Retention 130
Find customers who do not have any completed order. The query should be safe even when the orders table contains NULL customer_id values. The important part is NULL-safe exclusion. In production pipelines, failed events and guest checkouts often create NULL foreign keys that can break NOT IN logic.
SQL Coverage Pack 14m
Order Absence Reconciliation: First Activity Retention 131
Find customers who do not have any completed order. The query should be safe even when the orders table contains NULL customer_id values. The important part is NULL-safe exclusion. In production pipelines, failed events and guest checkouts often create NULL foreign keys that can break NOT IN logic.
SQL Coverage Pack 12m
Shipment Timeliness Metric: Operations SLA Metric 132
Calculate the percentage of delivery records where order_date equals delivered_date. The important part is building the exact SLA numerator and denominator. Counting rows alone is not a rate, and date equality must be checked per delivery.
SQL Coverage Pack 15m
Ad CTR Metric Rebuild: Conditional Engagement Metric 133
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 16m
Warehouse Product Availability: Warehouse Grain Reconciliation 134
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Bin-Level Stock Rollup: Warehouse Grain Reconciliation 135
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Zero-Stock Snapshot Reconciliation: Warehouse Grain Reconciliation 136
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Founder Dashboard Revenue Fix: Completed-Order Revenue 137
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 16m
Warehouse Availability Guardrail: Warehouse Grain Reconciliation 138
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 15m
Ad CTR Metric Rebuild: Conditional Engagement Metric 139
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 10m
Reference Dimension Filter Audit: Reference Dimension Filter 140
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 16m
Bin-Level Stock Rollup: Warehouse Grain Reconciliation 141
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Zero-Stock Snapshot Reconciliation: Warehouse Grain Reconciliation 142
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 10m
Regional Enablement Filter: Reference Dimension Filter 143
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 18m
Payroll Top-Band Audit: Workforce Ranking 144
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Department Salary Band Leaderboard: Workforce Ranking 145
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 15m
Debit Credit Netting Drill: Signed Finance Ledger 146
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 18m
Product Revenue Grain Audit: Completed-Order Revenue 147
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 16m
Zero-Stock Snapshot Reconciliation: Warehouse Grain Reconciliation 148
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Founder Dashboard Revenue Fix: Completed-Order Revenue 149
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 16m
Warehouse Availability Guardrail: Warehouse Grain Reconciliation 150
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Department Salary Band Leaderboard: Workforce Ranking 151
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Cancelled Order Leakage Check: Completed-Order Revenue 152
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Activation Cohort Follow-up: First Activity Retention 153
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 16m
Zero-Stock Snapshot Reconciliation: Warehouse Grain Reconciliation 154
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Founder Dashboard Revenue Fix: Completed-Order Revenue 155
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 15m
High-Value Balance Change Audit: Signed Finance Ledger 156
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 16m
Inventory Snapshot Grain Fix: Warehouse Grain Reconciliation 157
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Warehouse Product Availability: Warehouse Grain Reconciliation 158
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Product Revenue Grain Audit: Completed-Order Revenue 159
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Manager Org Salary Snapshot: Workforce Ranking 160
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
HR Leaderboard Window Function: Workforce Ranking 161
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
New User Return Signal: First Activity Retention 162
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
Department Salary Band Leaderboard: Workforce Ranking 163
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 15m
Campaign Click-Through Audit: Conditional Engagement Metric 164
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 10m
Country Threshold Logic Fix: Reference Dimension Filter 165
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 10m
OR Rule Reporting Drill: Reference Dimension Filter 166
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 10m
Regional Enablement Filter: Reference Dimension Filter 167
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 14m
CRM Reactivation Candidate Pull: First Activity Retention 168
Find customers who do not have any completed order. The query should be safe even when the orders table contains NULL customer_id values. The important part is NULL-safe exclusion. In production pipelines, failed events and guest checkouts often create NULL foreign keys that can break NOT IN logic.
SQL Coverage Pack 16m
Inventory Snapshot Grain Fix: Warehouse Grain Reconciliation 169
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Compensation Dashboard Tie Handling: Workforce Ranking 170
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Team Pay Ranking Reconciliation: Workforce Ranking 171
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 16m
Zero-Stock Snapshot Reconciliation: Warehouse Grain Reconciliation 172
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 12m
Missing Profile Preservation Check: Profile Enrichment Join 173
Return all customers with their profile city when available. Customers without a profile should still appear with NULL city. The important part is coverage: the output must preserve every base customer row even when enrichment data is missing. This is a common production issue when optional dimension/profile tables arrive late.
SQL Coverage Pack 12m
Customer 360 Left Join Audit: Profile Enrichment Join 174
Return all customers with their profile city when available. Customers without a profile should still appear with NULL city. The important part is coverage: the output must preserve every base customer row even when enrichment data is missing. This is a common production issue when optional dimension/profile tables arrive late.
SQL Coverage Pack 15m
Signed Ledger Balance Movement: Signed Finance Ledger 175
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 16m
Warehouse Product Availability: Warehouse Grain Reconciliation 176
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 15m
Impression Denominator Check: Conditional Engagement Metric 177
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 15m
Account Movement Exception Report: Signed Finance Ledger 178
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 16m
Current Inventory Mart Rebuild: Warehouse Grain Reconciliation 179
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Order Status Revenue Guardrail: Completed-Order Revenue 180
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Completed-Order Revenue Mart: Completed-Order Revenue 181
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 16m
Warehouse Product Availability: Warehouse Grain Reconciliation 182
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Bin-Level Stock Rollup: Warehouse Grain Reconciliation 183
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 12m
Fulfillment SLA Rate Rebuild: Operations SLA Metric 184
Calculate the percentage of delivery records where order_date equals delivered_date. The important part is building the exact SLA numerator and denominator. Counting rows alone is not a rate, and date equality must be checked per delivery.
SQL Coverage Pack 16m
Current Inventory Mart Rebuild: Warehouse Grain Reconciliation 185
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Warehouse Availability Guardrail: Warehouse Grain Reconciliation 186
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Department Salary Band Leaderboard: Workforce Ranking 187
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 15m
Campaign Click-Through Audit: Conditional Engagement Metric 188
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 10m
Country Threshold Logic Fix: Reference Dimension Filter 189
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 18m
E-commerce Item Revenue Rebuild: Completed-Order Revenue 190
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 10m
Regional Enablement Filter: Reference Dimension Filter 191
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 16m
Warehouse Availability Guardrail: Warehouse Grain Reconciliation 192
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Inventory Snapshot Grain Fix: Warehouse Grain Reconciliation 193
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Warehouse Product Availability: Warehouse Grain Reconciliation 194
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 16m
Bin-Level Stock Rollup: Warehouse Grain Reconciliation 195
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 15m
Account Movement Exception Report: Signed Finance Ledger 196
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 18m
HR Leaderboard Window Function: Workforce Ranking 197
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 15m
Zero-Impression CTR Guardrail: Conditional Engagement Metric 198
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 15m
Ad CTR Metric Rebuild: Conditional Engagement Metric 199
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 18m
First Activity Return Check: First Activity Retention 200
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
Product Revenue Grain Audit: Completed-Order Revenue 201
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 10m
OR Rule Reporting Drill: Reference Dimension Filter 202
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 10m
Regional Enablement Filter: Reference Dimension Filter 203
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 18m
New User Return Signal: First Activity Retention 204
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
Next-Day Product Retention: First Activity Retention 205
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 12m
Logistics Promise Reconciliation: Operations SLA Metric 206
Calculate the percentage of delivery records where order_date equals delivered_date. The important part is building the exact SLA numerator and denominator. Counting rows alone is not a rate, and date equality must be checked per delivery.
SQL Coverage Pack 18m
Product Revenue Grain Audit: Completed-Order Revenue 207
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
E-commerce Item Revenue Rebuild: Completed-Order Revenue 208
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
HR Leaderboard Window Function: Workforce Ranking 209
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Payroll Top-Band Audit: Workforce Ranking 210
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Department Salary Band Leaderboard: Workforce Ranking 211
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Cancelled Order Leakage Check: Completed-Order Revenue 212
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Product Revenue Grain Audit: Completed-Order Revenue 213
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
E-commerce Item Revenue Rebuild: Completed-Order Revenue 214
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 16m
Current Inventory Mart Rebuild: Warehouse Grain Reconciliation 215
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
New User Return Signal: First Activity Retention 216
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
Next-Day Product Retention: First Activity Retention 217
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
Compensation Dashboard Tie Handling: Workforce Ranking 218
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Team Pay Ranking Reconciliation: Workforce Ranking 219
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 12m
Class Enrollment Quality Report: Distinct Enrollment Threshold 220
Find classes with at least five distinct enrolled students. The important part is counting unique students, not enrollment events. Retry events or duplicate rows should not inflate class capacity numbers.
SQL Coverage Pack 18m
App Event Retention Rebuild: First Activity Retention 221
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
Order Status Revenue Guardrail: Completed-Order Revenue 222
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 12m
Distinct Enrollment Threshold: Distinct Enrollment Threshold 223
Find classes with at least five distinct enrolled students. The important part is counting unique students, not enrollment events. Retry events or duplicate rows should not inflate class capacity numbers.
SQL Coverage Pack 18m
First Activity Return Check: First Activity Retention 224
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 15m
Impression Denominator Check: Conditional Engagement Metric 225
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 15m
Account Movement Exception Report: Signed Finance Ledger 226
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 18m
Founder Dashboard Revenue Fix: Completed-Order Revenue 227
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 16m
Warehouse Availability Guardrail: Warehouse Grain Reconciliation 228
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 10m
Market Eligibility Rule Check: Reference Dimension Filter 229
Return countries that qualify as large markets by population or area. The important part is translating the business rule exactly. When the rule says either threshold qualifies, using AND silently removes valid records.
SQL Coverage Pack 18m
First Activity Return Check: First Activity Retention 230
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
Activation Cohort Follow-up: First Activity Retention 231
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 18m
User Day-One Retention Audit: First Activity Retention 232
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.
SQL Coverage Pack 12m
Ops Dashboard Delivery Check: Operations SLA Metric 233
Calculate the percentage of delivery records where order_date equals delivered_date. The important part is building the exact SLA numerator and denominator. Counting rows alone is not a rate, and date equality must be checked per delivery.
SQL Coverage Pack 16m
Warehouse Availability Guardrail: Warehouse Grain Reconciliation 234
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Department Salary Band Leaderboard: Workforce Ranking 235
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
Cancelled Order Leakage Check: Completed-Order Revenue 236
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 15m
Finance Threshold Reconciliation: Signed Finance Ledger 237
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 15m
Account Movement Exception Report: Signed Finance Ledger 238
Compute net balance change per account and return only accounts above 10000. The important part is financial sign handling. Credits and debits move balances in opposite directions, so a plain SUM(amount) can produce a dangerously wrong report.
SQL Coverage Pack 16m
Current Inventory Mart Rebuild: Warehouse Grain Reconciliation 239
Aggregate bin-level inventory for the latest snapshot date and return positive stock only. The important part is matching the output grain to the report grain. Bin-level or event-level input often needs to be aggregated before it becomes a warehouse mart.
SQL Coverage Pack 18m
Order Status Revenue Guardrail: Completed-Order Revenue 240
Calculate completed-order revenue per product and category from order_items joined to products and orders. The important part is filtering to valid revenue before aggregation. Cancelled or non-completed orders can inflate downstream marts if the status filter is missed.
SQL Coverage Pack 18m
Department Salary Band Leaderboard: Workforce Ranking 241
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 15m
Campaign Click-Through Audit: Conditional Engagement Metric 242
Calculate click-through rate percentage per ad as clicks divided by impressions. Avoid divide-by-zero failures. The important part is conditional counting. The metric should divide clicks by impressions, not by all events, and should avoid divide-by-zero failures.
SQL Coverage Pack 18m
Team Pay Ranking Reconciliation: Workforce Ranking 243
Return the employees in the top two salary bands per department. If multiple employees share the same salary band, include all of them. The important part is ranking inside each group, not globally. A query that uses a global LIMIT may look correct on tiny data but fails as soon as each department needs its own leaderboard.
SQL Coverage Pack 18m
User Day-One Retention Audit: First Activity Retention 244
Find users who had at least one event exactly one day after their first recorded event date. The important part is measuring activity relative to each user's first event date. Multiple events per day should not change the user-level retention answer.