Created
March 26, 2022 17:39
-
-
Save elyasha/77180d61b1350db0de45b48cad0d73e3 to your computer and use it in GitHub Desktop.
LEARN SQL Lyft Trip Data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM trips; | |
SELECT * FROM riders; | |
SELECT * FROM cars; | |
select * from riders cross join cars; | |
select * from trips left join riders on trips.rider_id = riders.id; | |
select * from trips join cars on trips.car_id = cars.id; | |
select * from riders union select * from riders2; | |
select avg(cost) from trips; | |
select * from riders where total_trips < 500; | |
select * from riders where total_trips < 500 | |
union | |
select * from riders2 where total_trips < 500; | |
select count(*) from cars where status = 'active'; | |
select * from cars order by trips_completed desc limit 2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment