Given a complex relational database of parts inventory and supplier lead times, write a query to find the top three suppliers by fulfillment speed using window functions.
Use the provided supplier, parts inventory, and purchase order data. Fulfillment speed is based on completed purchase orders only.
Output
- One row per supplier in the top three.
- Return
supplier_name, avg_fulfillment_days, fulfilled_orders, and fulfillment_rank.
- Sort by rank ascending, average fulfillment days ascending, and supplier ID ascending for ties.