Unbroken Chains of Loyalty

76. Unbroken Chains of Loyalty

Amid the constellations of commerce, only a few customers blaze with streaks unbroken across the passing months.

Xorthax wants to find the single longest streak of consecutive months where each customer placed at least one order. Show the the first day of the start month as a date, the first day of the end month as a date, and streak length for each customer, ordered by the highest streaks first.
Write Your Query
Next Problem β†’
Ace the Data Science Interview
Ace the Data Science Interview

Comprehensive prep for data interviews: SQL, stats, product sense, and case studies.

(Affiliate link – as an Amazon Associate I earn from qualifying purchases.)