SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Job Status Periods

Unsolved

A nightly batch job runs once a day. Days when it failed are listed in failed and days when it succeeded are listed in succeeded; every day appears in exactly one table. For January 2025 only (2025-01-01 to 2025-01-31, using only days inside that range), merge consecutive days with the same result into periods. Write an SQL query that returns period_state ('failed' or 'succeeded'), start_date and end_date for each period. Order the results by start_date ascending.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
Classic pattern · not tied to a specific company

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM failed
Full source dataset
4 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine