In the DoorDash system, if a customer's preferred delivery date is the same as the order date, the order is called immediate; otherwise, it is called scheduled.
The first order of a customer is the order with the earliest order date that the customer has made. It is guaranteed that a customer has precisely one first order (no two orders on the same earliest day).
Write an SQL query to find the percentage of immediate orders in the first orders of all customers.
| delivery_id(INTEGER) | customer_id(INTEGER) | order_date(DATE) | customer_pref_delivery_date(DATE) |
|---|---|---|---|
| 1 | 1 | 2019-08-01 | 2019-08-01 |
| 2 | 2 | 2019-08-02 | 2019-08-02 |
| 3 | 1 | 2019-08-11 | 2019-08-12 |
| 4 | 3 | 2019-08-24 | 2019-08-24 |
| 5 | 3 | 2019-08-21 | 2019-08-22 |
| 6 | 2 | 2019-08-11 | 2019-08-13 |
| 7 | 4 | 2019-08-09 | 2019-08-09 |
| 8 | 4 | 2019-08-10 | 2019-08-10 |
| 9 | 5 | 2019-08-01 | 2019-08-01 |
| 10 | 5 | 2019-08-05 | 2019-08-05 |
| 11 | 6 | 2019-08-01 | 2019-08-02 |
| 12 | 7 | 2019-08-01 | 2019-08-01 |
| immediate_percentage(DECIMAL) |
|---|
| 71.43 |