-- DBMS: bigquery
CREATE TABLE `bigquery-public-data.epa_historical_air_quality.air_quality_annual_summary`
(
  state_code STRING OPTIONS(description="The FIPS code of the state in which the monitor resides."),
  county_code STRING OPTIONS(description="The FIPS code of the county in which the monitor resides."),
  site_num STRING OPTIONS(description="A unique number within the county identifying the site."),
  parameter_code INT64 OPTIONS(description="The AQS code corresponding to the parameter measured by the monitor."),
  poc INT64 OPTIONS(description="This is the 'Parameter Occurrence Code' used to distinguish different instruments that measure the same parameter at the same site."),
  latitude FLOAT64 OPTIONS(description="The monitoring site’s angular distance north of the equator measured in decimal degrees."),
  longitude FLOAT64 OPTIONS(description="The monitoring site’s angular distance east of the prime meridian measured in decimal degrees."),
  datum STRING OPTIONS(description="The Datum associated with the Latitude and Longitude measures."),
  parameter_name STRING OPTIONS(description="The name or description assigned in AQS to the parameter measured by the monitor. Parameters may be pollutants or non-pollutants."),
  sample_duration STRING OPTIONS(description="The length of time that air passes through the monitoring device before it is analyzed (measured). So, it represents an averaging period in the atmosphere (for example, a 24-hour sample duration draws ambient air over a collection filter for 24 straight hours). For continuous monitors, it can represent an averaging time of many samples (for example, a 1-hour value may be the average of four one-minute samples collected during each quarter of the hour)."),
  pollutant_standard STRING OPTIONS(description="A description of the ambient air quality standard rules used to aggregate statistics. (See description at beginning of document.)"),
  metric_used STRING OPTIONS(description="The base metric used in the calculation of the aggregate statistics presented in the remainder of the row. For example, if this is Daily Maximum, then the value in the Mean column is the mean of the daily maximums."),
  method_name STRING OPTIONS(description="A short description of the processes, equipment, and protocols used in gathering and measuring the sample."),
  year INT64 OPTIONS(description="The year the annual summary data represents."),
  units_of_measure STRING OPTIONS(description="The unit of measure for the parameter. QAD always returns data in the standard units for the parameter. Submitters are allowed to report data in any unit and EPA converts to a standard unit so that we may use the data in calculations."),
  event_type STRING OPTIONS(description="Indicates whether data measured during exceptional events are included in the summary. A wildfire is an example of an exceptional event; it is something that affects air quality, but the local agency has no control over. No Events means no events occurred. Events Included means events occurred and the data from them is included in the summary. Events Excluded means that events occurred but data form them is excluded from the summary. Concurred Events Excluded means that events occurred but only EPA concurred exclusions are removed from the summary. If an event occurred for the parameter in question, the data will have multiple records for each monitor."),
  observation_count INT64 OPTIONS(description="The number of observations (samples) taken during the year."),
  observation_percent FLOAT64 OPTIONS(description="The percent representing the number of observations taken with respect to the number scheduled to be taken during the year. This is only calculated for monitors where measurements are required (e.g., only certain parameters)."),
  completeness_indicator STRING OPTIONS(description="An indication of whether the regulatory data completeness criteria for valid summary data have been met by the monitor for the year. Y means yes, N means no or that there are no regulatory completeness criteria for the parameter."),
  valid_day_count INT64 OPTIONS(description="The number of days during the year where the daily monitoring criteria were met, if the calculation of the summaries is based on valid days."),
  required_day_count INT64 OPTIONS(description="The number of days during the year which the monitor was scheduled to take samples if measurements are required."),
  exceptional_data_count INT64 OPTIONS(description="The number of data points in the annual data set affected by exceptional air quality events (things outside the norm that affect air quality)."),
  null_data_count INT64 OPTIONS(description="The count of scheduled samples when no data was collected and the reason for no data was reported."),
  primary_exceedance_count INT64 OPTIONS(description="The number of samples during the year that exceeded the primary air quality standard."),
  secondary_exceedance_count INT64 OPTIONS(description="The number of samples during the year that exceeded the secondary air quality standard."),
  certification_indicator STRING OPTIONS(description="An indication whether the completeness and accuracy of the information on the annual summary record has been certified by the submitter. Certified means the submitter has certified the data (due May 01 the year after collection). Certification not required means that the parameter does not require certification or the deadline has not yet passed. Uncertified (past due) means that certification is required but is overdue. Requested but not yet concurred means the submitter has completed the process, but EPA has not yet acted to certify the data. Requested but denied means the submitter has completed the process, but EPA has denied the request for cause. Was certified but data changed means the data was certified but data was replaced and the process has not been repeated."),
  num_obs_below_mdl INT64 OPTIONS(description="The number of samples reported during the year that were below the method detection limit (MDL) for the monitoring instrument. Sometimes these values are replaced by 1/2 the MDL in summary calculations."),
  arithmetic_mean FLOAT64 OPTIONS(description="The average (arithmetic mean) value for the year."),
  arithmetic_standard_dev FLOAT64 OPTIONS(description="The standard deviation about the mean of the values for the year."),
  first_max_value FLOAT64 OPTIONS(description="The highest value for the year."),
  first_max_datetime TIMESTAMP OPTIONS(description="The date and time (on a 24-hour clock) when the highest value for the year (the previous field) was taken."),
  second_max_value FLOAT64 OPTIONS(description="The second highest value for the year."),
  second_max_datetime TIMESTAMP OPTIONS(description="The date and time (on a 24-hour clock) when the second highest value for the year (the previous field) was taken."),
  third_max_value FLOAT64 OPTIONS(description="The third highest value for the year."),
  third_max_datetime TIMESTAMP OPTIONS(description="The date and time (on a 24-hour clock) when the third highest value for the year (the previous field) was taken."),
  fourth_max_value FLOAT64 OPTIONS(description="The fourth highest value for the year."),
  fourth_max_datetime TIMESTAMP OPTIONS(description="The date and time (on a 24-hour clock) when the fourth highest value for the year (the previous field) was taken."),
  first_max_non_overlapping_value FLOAT64 OPTIONS(description="For 8-hour CO averages, the highest value of the year."),
  first_no_max_datetime TIMESTAMP OPTIONS(description="The date and time (on a 24-hour clock) when the first maximum non overlapping value for the year (the previous field) was taken."),
  second_max_non_overlapping_value FLOAT64 OPTIONS(description="For 8-hour CO averages, the second highest value of the year that does not share any hours with the 8-hour period of the first max non overlapping value."),
  second_no_max_datetime TIMESTAMP OPTIONS(description="The date and time (on a 24-hour clock) when the second maximum non overlapping value for the year (the previous field) was taken."),
  ninety_nine_percentile FLOAT64 OPTIONS(description="The value from this monitor for which 99 per cent of the rest of the measured values for the year are equal to or less than."),
  ninety_eight_percentile FLOAT64 OPTIONS(description="The value from this monitor for which 98 per cent of the rest of the measured values for the year are equal to or less than."),
  ninety_five_percentile FLOAT64 OPTIONS(description="The value from this monitor for which 95 per cent of the rest of the measured values for the year are equal to or less than."),
  ninety_percentile FLOAT64 OPTIONS(description="The value from this monitor for which 90 per cent of the rest of the measured values for the year are equal to or less than."),
  seventy_five_percentile FLOAT64 OPTIONS(description="The value from this monitor for which 75 per cent of the rest of the measured values for the year are equal to or less than."),
  fifty_percentile FLOAT64 OPTIONS(description="The value from this monitor for which 50 per cent of the rest of the measured values for the year are equal to or less than (i.e., the median)."),
  ten_percentile FLOAT64 OPTIONS(description="The value from this monitor for which 10 per cent of the rest of the measured values for the year are equal to or less than."),
  local_site_name STRING OPTIONS(description="The name of the site (if any) given by the State, local, or tribal air pollution control agency that operates it."),
  address STRING OPTIONS(description="The approximate street address of the monitoring site."),
  state_name STRING OPTIONS(description="The name of the state where the monitoring site is located."),
  county_name STRING OPTIONS(description="The name of the county where the monitoring site is located."),
  city_name STRING OPTIONS(description="The name of the city where the monitoring site is located. This represents the legal incorporated boundaries of cities and not urban areas."),
  cbsa_name STRING OPTIONS(description="The name of the core bases statistical area (metropolitan area) where the monitoring site is located."),
  date_of_last_change DATE OPTIONS(description="The date the last time any numeric values in this record were updated in the AQS data system.")
)
OPTIONS(
  description=""
);

INSERT INTO `bigquery-public-data.epa_historical_air_quality.air_quality_annual_summary` (state_code, county_code, site_num, parameter_code, poc, latitude, longitude, datum, parameter_name, sample_duration, pollutant_standard, metric_used, method_name, year, units_of_measure, event_type, observation_count, observation_percent, completeness_indicator, valid_day_count, required_day_count, exceptional_data_count, null_data_count, primary_exceedance_count, secondary_exceedance_count, certification_indicator, num_obs_below_mdl, arithmetic_mean, arithmetic_standard_dev, first_max_value, first_max_datetime, second_max_value, second_max_datetime, third_max_value, third_max_datetime, fourth_max_value, fourth_max_datetime, first_max_non_overlapping_value, first_no_max_datetime, second_max_non_overlapping_value, second_no_max_datetime, ninety_nine_percentile, ninety_eight_percentile, ninety_five_percentile, ninety_percentile, seventy_five_percentile, fifty_percentile, ten_percentile, local_site_name, address, state_name, county_name, city_name, cbsa_name, date_of_last_change) VALUES ('02', '185', '0041', 61101, 1, 70.263611, -148.756938, 'WGS84', 'Wind Speed - Scalar', '1 HOUR', NULL, 'Observed Values', 'INSTRUMENTAL - ELECTRONIC OR MACHINE AVG.', 1980, 'Knots', 'No Events', 1911, 88.0, 'Y', 78, 91, 0, 0, NULL, NULL, 'Certification not required', 0, 11.814914, 6.874623, 33.6, '1980-01-08 10:00:00+00:00', 32.9, '1980-02-23 11:00:00+00:00', 32.7, '1980-03-15 12:00:00+00:00', 32.2, '1980-01-07 18:00:00+00:00', nan, 'NaT', nan, 'NaT', 30.0, 28.1, 25.4, 21.6, 15.8, 10.8, 4.0, NULL, 'SOHIO DRILL PAD A', 'Alaska', 'North Slope ', 'Not in a city', NULL, '2020-05-21'), ('08', '005', '1002', 61103, 1, 39.71721, -104.84192, 'WGS84', 'Wind Speed - Resultant', '1 HOUR', NULL, 'Observed Values', 'INSTRUMENTAL - VECTOR SUMMATION', 1980, 'Knots', 'No Events', 1166, 40.0, 'N', 44, 122, 0, 0, NULL, NULL, 'Certification not required', 0, 5.548885, 3.002533, 18.0, '1980-11-28 10:00:00+00:00', 16.0, '1980-11-12 19:00:00+00:00', 16.0, '1980-11-28 11:00:00+00:00', 16.0, '1980-12-04 13:00:00+00:00', nan, 'NaT', nan, 'NaT', 13.0, 12.0, 10.0, 9.0, 8.0, 5.0, 2.0, NULL, '50 S. PEORIA AVE.', 'Colorado', 'Arapahoe', 'Aurora', 'Denver-Aurora-Lakewood, CO', '2020-05-21'), ('12', '099', '0006', 61101, 2, 26.702842, -80.383384, 'WGS84', 'Wind Speed - Scalar', '1 HOUR', NULL, 'Observed Values', 'INSTRUMENTAL - ELECTRONIC OR MACHINE AVG.', 1980, 'Knots', 'No Events', 2114, 97.0, 'Y', 87, 91, 0, 0, NULL, NULL, 'Certification not required', 0, 3.603217, 3.318368, 19.1, '1980-03-02 17:00:00+00:00', 17.4, '1980-03-02 15:00:00+00:00', 16.5, '1980-03-02 12:00:00+00:00', 16.5, '1980-03-02 13:00:00+00:00', nan, 'NaT', nan, 'NaT', 13.0, 12.2, 10.4, 8.7, 6.1, 2.6, 0.0, NULL, 'STATE ROAD 80 AT TWENTY MILE BEND', 'Florida', 'Palm Beach', 'Not in a city', 'Miami-Fort Lauderdale-West Palm Beach, FL', '2020-05-21'), ('17', '167', '0007', 61103, 1, 39.839494, -89.636211, 'WGS84', 'Wind Speed - Resultant', '1 HOUR', NULL, 'Observed Values', 'INSTRUMENTAL - VECTOR SUMMATION', 1980, 'Knots', 'No Events', 4534, 93.0, 'Y', 183, 204, 0, 0, NULL, NULL, 'Certification not required', 0, 3.223952, 2.158406, 14.5, '1980-06-09 17:00:00+00:00', 14.4, '1980-06-09 16:00:00+00:00', 13.5, '1980-06-09 18:00:00+00:00', 12.1, '1980-02-25 10:00:00+00:00', nan, 'NaT', nan, 'NaT', 9.4, 8.4, 7.4, 6.3, 4.5, 2.9, 0.7, NULL, 'STATE FAIRGROUNDS', 'Illinois', 'Sangamon', 'Springfield', 'Springfield, IL', '2020-05-21'), ('18', '057', '0001', 61101, 1, 40.110864, -85.954961, 'WGS84', 'Wind Speed - Scalar', '1 HOUR', NULL, 'Observed Values', 'INSTRUMENTAL - ELECTRONIC OR MACHINE AVG.', 1980, 'Knots', 'No Events', 4130, 63.0, 'N', 168, 274, 0, 0, NULL, NULL, 'Certification not required', 0, 4.054358, 2.783081, 19.3, '1980-05-13 15:00:00+00:00', 18.8, '1980-05-13 16:00:00+00:00', 18.7, '1980-05-13 14:00:00+00:00', 18.1, '1980-05-13 18:00:00+00:00', nan, 'NaT', nan, 'NaT', 14.0, 12.3, 9.8, 7.7, 5.2, 3.2, 1.5, NULL, 'NEAR LIVESTOCK AUCTION, STATE RD. 37', 'Indiana', 'Hamilton', NULL, 'Indianapolis-Carmel-Anderson, IN', '2020-05-21');