Leetcode力扣 MySQL数据库 1635 Hopper公司查询

该SQL查询旨在报告Hopper公司在2020年每个月的驾驶员活跃数量(active_drivers)及接受的乘车次数(accepted_rides)。数据涉及Drivers, Rides, AcceptedRides三张表,通过分析司机加入日期和行程信息得出结果。" 18899299,65551,Golang实现Flash Socket安全策略文件解决方案,"['Golang', '网络编程', 'Flash开发', 'Socket编程']
摘要由CSDN通过智能技术生成

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ziko-1101

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值