Write a SQL query to find the length of the longest streak of consecutive days a customer ordered food on Zomato in the past year.
Asked in the Round 1: Technical stage. Use the customers and orders tables. For this exercise, treat the past year as 2024-01-01 through 2024-12-31.
customer_id, customer_name, and longest_streak_days.customer_id ascending.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique Zomato customer identifier |
| customer_name | VARCHAR(100) | Customer's display name |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique food order identifier |
| customer_id | INT | Customer who placed the order |
| order_date | DATE | Calendar date when the order was placed |