Given a list of pizza topping inventory and order timestamps, how do you determine if you have enough ingredients to fulfill all orders?
Write a PostgreSQL query that evaluates each order chronologically against the available topping quantities. Treat a topping with no inventory record or a NULL quantity as unavailable.
Output
- One row per order, including orders without line items.
- Columns:
order_id, order_timestamp, can_fulfill, and unavailable_toppings.
- Sort by
order_timestamp, then order_id ascending. List unavailable topping names alphabetically, or return NULL when all ingredients are available.