CREATE TABLE station (city VARCHAR, id VARCHAR)
CREATE TABLE trip (end_station_id VARCHAR, id VARCHAR)

How many trips started from Mountain View city and ended at Palo Alto city?
SELECT COUNT(*) FROM station AS T1 JOIN trip AS T2 JOIN station AS T3 JOIN trip AS T4 ON T1.id = T2.start_station_id AND T2.id = T4.id AND T3.id = T4.end_station_id WHERE T1.city = "Mountain View" AND T3.city = "Palo Alto"
SELECT COUNT(*) FROM "station" AS "T1" JOIN "station" AS "T3" ON "Palo Alto" = "T3"."city" JOIN "trip" AS "T4" ON "T3"."id" = "T4"."end_station_id" JOIN "trip" AS "T2" ON "T1"."id" = "T2"."start_station_id" AND "T2"."id" = "T4"."id" WHERE "Mountain View" = "T1"."city"