Where do the trips end?
select distinct t2.city from trip as t1 join station as t2 on t1.end_station_id = t2.id
How many trips are there?
select count ( * ) from trip as t1 join station as t2 on t1.end_station_id = t2.id
How many of these end in San Francisco?
select count ( * ) from trip as t1 join station as t2 on t1.end_station_id = t2.id where t2.city = "San Francisco"
How many end somewhere else?
select count ( * ) from trip as t1 join station as t2 on t1.end_station_id = t2.id where t2.city ! = "San Francisco"