1635 Hopper公司查询
SQL架构
Create table If Not Exists Drivers_1635 (driver_id int, join_date date);
Create table If Not Exists Rides_1635 (ride_id int, user_id int, requested_at date);
Create table If Not Exists AcceptedRides_1635 (ride_id int, driver_id int, ride_distance int, ride_duration int);
Truncate table Drivers_1635;
insert into Drivers_1635 (driver_id, join_date) values ('10', '2019-12-10');
insert into Drivers_1635 (driver_id, join_date) values ('8', '2020-1-13');
insert into Drivers_1635 (driver_id, join_date) values ('5', '2020-2-16');
insert into Drivers_1635 (driver_id, join_date) values ('7', '2020-3-8');
insert into Drivers_1635 (driver_id, join_date) values ('4', '2020-5-17');
insert into Drivers_1635 (driver_id, join_date) values ('1', '2020-10-24');
insert into Drivers_1635 (driver_id, join_date) values ('6', '2021-1-5');
Truncate table Rides_1635;
insert into Rides_1635 (ride_id, user_id, requested_at) values ('6', '75', '2019-12-9');
insert into Rides_1635 (ride_id, user_id, requested_at) values ('1', '54', '2020-2-9');
insert into Rides_1635 (ride_id, user_id, requested_at) values ('10', '63', '2020-3-4');
insert into Rides_1635 (ride_id, user_id, requested_at) values ('19', '39', '2020-4-6');
insert into Rides_1635 (ride_id, user_id, requested_at) values ('3', '41', '2020-6-3');
insert into Rides_1635 (ride_id, user_id, requested_at) values ('13', '52', '2020-6-22');
insert into Rides_1635 (ride_id, user_id, requested_at) values ('7', '69', '2020-7-16');
insert into Rides_1635 (ride_id, user_id, requested_at) values ('17', '70', '2020-8-25');
insert into Rides_1635 (ride_id, user_id, requested_at) values ('20', '81', '2020-11-2');
insert into Rides_1635 (ride_id, user_id, requested_at) values ('5', '57', '2020-11-9');
insert into Rides_1635 (ride_id, user_id, requested_at) values ('2', '42', '2020-12-9');
insert into Rides_1635 (ride_id, user_id, requested_at) values ('11', '6