Skip to content

Instantly share code, notes, and snippets.

@elyasha
Created March 26, 2022 17:39
Show Gist options
  • Save elyasha/77180d61b1350db0de45b48cad0d73e3 to your computer and use it in GitHub Desktop.
Save elyasha/77180d61b1350db0de45b48cad0d73e3 to your computer and use it in GitHub Desktop.
LEARN SQL Lyft Trip Data
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