Write a SQL query to find the top three most frequently ordered food categories by region over the last quarter for Sysco. Count each order line as one category order, exclude records outside the previous calendar quarter, and ignore lines without a category or matching order.
region, food_category, order_count, and category_rank.| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| region | VARCHAR(50) | Sysco sales region for the order |
| ordered_at | DATE | Date the order was placed |
| Column | Type | Description |
|---|---|---|
| order_line_idPK | INT | Unique order line identifier |
| order_id | INT | Order associated with the line |
| food_category | VARCHAR(80) | Food category ordered on the line |