bugfree Icon
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course

Leetcode Problem 1173. Immediate Food Delivery I

1173. Immediate Food Delivery I

Leetcode Solutions

Calculating Immediate Order Percentage

  1. Use the AVG() function with the boolean expression order_date = customer_pref_delivery_date to calculate the ratio of immediate orders to total orders.
  2. Multiply the result by 100 to convert the ratio to a percentage.
  3. Use the ROUND() function to round the result to two decimal places.
  4. Alias the result as immediate_percentage using the AS keyword.
  5. Select the rounded percentage from the Delivery table.
erDiagram
    Delivery {
        int delivery_id PK
        int customer_id
        date order_date
        date customer_pref_delivery_date
    }

Counting Immediate Orders and Total Orders

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...
bugfree Icon
OR