CREATE TABLE station (
    id NUMBER PRIMARY KEY,
    name TEXT,
    lat NUMBER,
    long NUMBER,
    dock_count NUMBER,
    city TEXT,
    installation_date TEXT
);
CREATE TABLE status (
    station_id NUMBER,
    bikes_available NUMBER,
    docks_available NUMBER,
    time TEXT,
    FOREIGN KEY ("station_id") REFERENCES station("id")
);
CREATE TABLE trip (
    id NUMBER PRIMARY KEY,
    duration NUMBER,
    start_date TEXT,
    start_station_name TEXT,
    start_station_id NUMBER,
    end_date TEXT,
    end_station_name TEXT,
    end_station_id NUMBER,
    bike_id NUMBER,
    subscription_type TEXT,
    zip_code NUMBER
);
CREATE TABLE weather (
    date TEXT,
    max_temperature_f NUMBER,
    mean_temperature_f NUMBER,
    min_temperature_f NUMBER,
    max_dew_point_f NUMBER,
    mean_dew_point_f NUMBER,
    min_dew_point_f NUMBER,
    max_humidity NUMBER,
    mean_humidity NUMBER,
    min_humidity NUMBER,
    max_sea_level_pressure_inches NUMBER,
    mean_sea_level_pressure_inches NUMBER,
    min_sea_level_pressure_inches NUMBER,
    max_visibility_miles NUMBER,
    mean_visibility_miles NUMBER,
    min_visibility_miles NUMBER,
    max_wind_Speed_mph NUMBER,
    mean_wind_speed_mph NUMBER,
    max_gust_speed_mph NUMBER,
    precipitation_inches NUMBER,
    cloud_cover NUMBER,
    events TEXT,
    wind_dir_degrees NUMBER,
    zip_code NUMBER
);

Question: What are the zip codes that have an average mean humidity below 70 and had at least 100 trips come through there?
SQL: SELECT zip_code FROM weather GROUP BY zip_code HAVING avg(mean_humidity)  <  70 INTERSECT SELECT zip_code FROM trip GROUP BY zip_code HAVING count(*)  >=  100

Question: What are the names of stations that are located in Palo Alto city but have never been the ending point of trips more than 100 times?
SQL: SELECT name FROM station WHERE city  =  "Palo Alto" EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING count(*)  >  100

Question: What are the names of the stations that are located in Palo Alto but have never been the ending point of the trips
SQL: SELECT name FROM station WHERE city  =  "Palo Alto" EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING count(*)  >  100

Question: How many trips started from Mountain View city and ended at Palo Alto city?
SQL: 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"

Question: How many trips stated from  a station in Mountain View and ended at one in Palo Alto?
SQL: 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"

Question: What is the average latitude and longitude of the starting points of all trips?
SQL: SELECT avg(T1.lat) ,  avg(T1.long) FROM station AS T1 JOIN trip AS T2 ON T1.id  =  T2.start_station_id

Question: What is the average latitude and longitude of all starting stations for the trips?
SQL: SELECT avg(T1.lat) ,  avg(T1.long) FROM station AS T1 JOIN trip AS T2 ON T1.id  =  T2.start_station_id