#SQL

Publicado em: 08 Setembro 2024
no canal de: 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  


Nesta página do site você pode assistir ao vídeo on-line #SQL duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário The Code Samples 08 Setembro 2024, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 214 vezes e gostou 15 espectadores. Boa visualização!