stadium_traffic.sql
PostgreSQL 18.6
Not run yet
+ 6 hidden
Input
stadium_day day_id open_date visitors 1 2025-03-01 850 2 2025-03-02 1200 3 2025-03-04 1430 4 2025-03-05 1000 5 2025-03-07 640 6 2025-03-08 2100 7 2025-03-09 1800 8 2025-03-11 300
Expected
[{"day_id": 2, "open_date": "2025-03-02", "visitors": 1200}, {"day_id": 3, "open_date": "2025-03-04", "visitors": 1430}, {"day_id": 4, "open_date": "2025-03-05", "visitors": 1000}]Days 2, 3 and 4 are busy (exactly 1,000 counts). March 3 has no row because the stadium was closed, so day 3 still follows day 2. Days 6 and 7 are busy too, but two days are not a streak of three.