Table: vehicle_emissions_2
Columns: vehicle
operating_mode
epa_rated_all_electric_range
epa_rated_combined_fuel_economy
clean_electric_grid_california_san_francisco
u_s_national_average_electric_mix
dirty_electric_grid_rocky_mountains_denver

Question: When bmw activee is the vehicle type how many clean electric grid california (san francisco) measurements are there?
SQL: SELECT COUNT("clean_electric_grid_california_san_francisco") FROM vehicle_emissions_2 WHERE "vehicle" = 'BMW ActiveE'

Question: When 102 mpg-e (33kw-hrs/100mi) is the epa rated combined fuel economy what is the vehicle type? 
SQL: SELECT "vehicle" FROM vehicle_emissions_2 WHERE "epa_rated_combined_fuel_economy" = '102 mpg-e (33kW-hrs/100mi)'

Question: When 100 g/mi (62 g/km) is the clean electric grid california (san francisco) how many vehicles are there?
SQL: SELECT COUNT("vehicle") FROM vehicle_emissions_2 WHERE "clean_electric_grid_california_san_francisco" = '100 g/mi (62 g/km)'

Question: When 380 g/mi (236 g/km) is the dirty electric grid rocky mountains (denver) what is the u.s national average electric mix?
SQL: SELECT "u_s_national_average_electric_mix" FROM vehicle_emissions_2 WHERE "dirty_electric_grid_rocky_mountains_denver" = '380 g/mi (236 g/km)'

Question: When bmw activee is the vehicle type what is the u.s national average electric mix?
SQL: SELECT "u_s_national_average_electric_mix" FROM vehicle_emissions_2 WHERE "vehicle" = 'BMW ActiveE'

Question: When  87 mpg-e (39kw-hrs/100mi) is the  epa rated combined fuel economy how many operating modes are there?
SQL: SELECT COUNT("operating_mode") FROM vehicle_emissions_2 WHERE "epa_rated_combined_fuel_economy" = '87 mpg-e (39kW-hrs/100mi)'