#SQL

Publié le: 08 septembre 2024
sur la chaîne: The Code Samples
214
15

#SQL Leetcode SQL 50 #21: 1174:
Write a solution to find the percentage of immediate orders in the first orders of all customers, rounded to 2 decimal places. If the customer's preferred delivery date is the same as the order date, then 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 made. It is guaranteed that a customer has precisely one first order. We will be using subquery to solve this.

We will be solving all the questions from LeetCode SQL 50 one by one. These questions range from easy to hard.

**SQL scripts you can use to create and populate the table:
-- Create the Delivery table
CREATE TABLE Delivery (
delivery_id INT,
customer_id INT,
order_date DATE,
customer_pref_delivery_date DATE
);

-- Insert data into the Delivery table
INSERT INTO Delivery (delivery_id, customer_id, order_date, customer_pref_delivery_date) VALUES
(1, 1, '2019-08-01', '2019-08-02'),
(2, 2, '2019-08-02', '2019-08-02');

#datascience #coding #programming #mssql #databasemanagement #leetcode #leetcode1174 #leetcodesolution

👉SQL Tutorials Playlist:
   • SQL Tutorials  

👉SQL Shorts Playlist:
   • SQL Shorts  

👉Python Shorts Playlist:
   • Playlist  

👉Python Tutorials Playlist:
   • Python Tutorials  

👉Excel Shorts Playlist:
   • Excel Shorts  


Sur cette page du site, vous pouvez voir la vidéo en ligne #SQL durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur The Code Samples 08 septembre 2024, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 214 fois et il a aimé 15 téléspectateurs. Bon visionnage!