advancedAdvanced SQL 20m est

Consecutive Days Sales Streaks

Problem Statement

Identify consecutive days where at least one order was placed. For each consecutive streak, return the start date (`streak_start`), the end date (`streak_end`), and the number of consecutive days (`consecutive_days`). Sort by `consecutive_days` descending.

Skills Evaluated

Gaps & IslandsWindow SubtractionROW_NUMBERDATE
Write your SQL query in the editor on the right and click **Run Query**. The system runs your query and compares the result dataset with the official solution. Results must match row-for-row, column-for-column.

Expected Output Format

Executing expected result set...
SQL Query WorkspaceSQLite v3.45 (WASM Mode)
QUICK INSERT:
1