Hi Learners! This is a real-world SQL interview problem. It has been asked in the Data Analyst Interview of Uber.
You can practice this problem by your own, below is the DDl and DML commands:
CREATE TABLE `sys`.`trips` (
`id` INT NOT NULL,
`client_id` VARCHAR(45) NULL,
`driver_id` VARCHAR(45) NULL,
`city_id` VARCHAR(45) NULL,
`status` VARCHAR(45) NULL,
`request_at` date NULL,
PRIMARY KEY (`id`));
insert into trips values (1 , '1' , '10' , '1' , 'completed' , '2023-10-01' ),
(2 , '2' , '11' , '1' , 'cancelled_by_driver' , '2023-10-01' ),
(3 , '3' , '12' , '6' , 'completed' , '2023-10-01' ),
(4 , '4' , '13' , '6' , 'cancelled_by_client' , '2023-10-01' ),
(5 , '1' , '10' , '1' , 'completed' , '2023-10-02' ),
(6 , '2' , '11' , '6' , 'completed' , '2023-10-02' ),
(7 , '3' , '12' , '6' , 'completed' , '2023-10-03' ),
(8 , '2' , '12' , '12' , 'completed' , '2023-10-03' ),
(9 , '3' , '10' , '12' , 'completed' , '2023-10-03' ),
(10 , '4' , '13' , '12' , 'cancelled_by_driver' , '2023-10-03' );
CREATE TABLE `sys`.`uber_users` (
`user_id` INT NOT NULL,
`banned` VARCHAR(45) NULL,
`role` VARCHAR(45) NULL,
PRIMARY KEY (`user_id`));
insert into uber_users values
(1, 'No', 'client'),
(2, 'Yes', 'client'),
(3, 'No', 'client'),
(4, 'No', 'client'),
(10, 'No', 'driver'),
(11, 'No', 'driver'),
(12, 'No', 'driver'),
(13, 'No', 'driver');
**************************************************
In this video, we will be discussing the step-by-step approach to the solution.
For a detailed understanding of SQL, refer to my Master SQL series.
• SQL Master series
Do subscribe to the channel for more videos and grab your dream job in data analytics.
YouTube: @AnalyticsWithVipul
Instagram: / learn_with_. .
Facebook: https://www.facebook.com/profile.php?...
LinkedIn: / vipul-gup. .
Got a question about the solution? Please share it in the comment section below.
If you also have an interesting problem that was asked in any of your previous interviews, do share it in the comment box and if I find it interesting, I will make a solution video on that in the future.
Thank You
Vipul Gupta
Nesta página do site você pode assistir ao vídeo on-line Uber Data Analyst Interview Question | Tricky SQL Interview Problem | Cracking SQL Interview duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Vipul Gupta 19 Março 2024, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 599 vezes e gostou 26 espectadores. Boa visualização!