-- DBMS: bigquery
CREATE TABLE `bigquery-public-data.san_francisco.sffd_service_calls`
(
  call_number INT64 NOT NULL OPTIONS(description="A unique 9-digit number assigned by the 911 Dispatch Center (DEM) to this call. These number are used for both Police and Fire calls."),
  unit_id STRING OPTIONS(description="Unit Identifier. For example E01 for Engine 1 or T01 for Truck 1."),
  incident_number INT64 OPTIONS(description="A unique 8-digit number assigned by DEM to this Fire incident."),
  call_type STRING OPTIONS(description="Type of call the incident falls into. See the list below."),
  call_date DATE OPTIONS(description="Date the call is received at the 911 Dispatch Center. Used for reporting purposes."),
  watch_date DATE OPTIONS(description="Watch date when the call is received. Watch date starts at 0800 each morning and ends at 0800 the next day."),
  received_timestamp TIMESTAMP OPTIONS(description="Date and time of call is received at the 911 Dispatch Center."),
  entry_timestamp TIMESTAMP OPTIONS(description="Date and time the 911 operator submits the entry of the initical call information into the CAD system"),
  dispatch_timestamp TIMESTAMP OPTIONS(description="Date and time the 911 operator dispatches this unit to the call."),
  response_timestamp TIMESTAMP OPTIONS(description="Date and time this unit acknowledges the dispatch and records that the unit is en route to the location of the call."),
  on_scene_timestamp TIMESTAMP OPTIONS(description="Date and time the unit records arriving to the location of the incident"),
  transport_timestamp TIMESTAMP OPTIONS(description="If this unit is an ambulance, date and time the unit begins the transport unit arrives to hospital"),
  hospital_timestamp TIMESTAMP OPTIONS(description="If this unit is an ambulance, date and time the unit arrives to the hospital."),
  call_final_disposition STRING OPTIONS(description="Disposition of the call (Code). For example TH2: Transport to Hospital - Code 2, FIR: Resolved by Fire Department"),
  available_timestamp TIMESTAMP OPTIONS(description="Date and time this unit is not longer assigned to this call and it is available for another dispatch."),
  address STRING OPTIONS(description="Address of midblock point associated with incident (obfuscated address to protect caller privacy)"),
  city STRING OPTIONS(description="City of incident"),
  zipcode_of_incident STRING OPTIONS(description="Zipcode of incident"),
  battalion STRING OPTIONS(description="Emergency Response District (There are 9 Fire Emergency Response Districts)"),
  station_area STRING OPTIONS(description="Fire Station First Response Area associated with the address of the incident"),
  box STRING OPTIONS(description="Fire box associated with the address of the incident. A box is the smallest area used to divide the City. Each box is associated with a unique unit dispatch order. The City is divided into more than 2,400 boxes."),
  original_priority STRING OPTIONS(description="Initial call priority (Code 2: Non-Emergency or Code 3:Emergency)."),
  priority STRING OPTIONS(description="Call priority (Code 2: Non-Emergency or Code 3:Emergency)."),
  final_priority INT64 OPTIONS(description="Final call priority (Code 2: Non-Emergency or Code 3:Emergency)."),
  als_unit BOOL OPTIONS(description="Does this unit includes ALS (Advance Life Support) resources? Is there a paramedic in this unit?"),
  call_type_group STRING OPTIONS(description="Call types are divided into four main groups: Fire, Alarm, Potential Life Threatening and Non Life Threatening."),
  number_of_alarms INT64 OPTIONS(description="Number of alarms associated with the incident. This is a number between 1 and 5."),
  unit_type STRING OPTIONS(description="Unit type"),
  unit_sequence_in_call_dispatch INT64 OPTIONS(description="A number that indicates the order this unit was assigned to this call"),
  fire_prevention_district STRING OPTIONS(description="Bureau of Fire Prevention District associated with this address"),
  supervisor_district STRING OPTIONS(description="Supervisor District associated with this address"),
  neighborhood_district STRING OPTIONS(description="Neighborhood District associated with this address, boundaries available here: https://data.sfgov.org/d/p5b7-5n3h"),
  location STRING OPTIONS(description="Latitude and longitude of address obfuscated either to the midblock, intersection or call box"),
  row_id STRING OPTIONS(description="Unique identifier used for managing data updates. It is the concatenation of Call Number and Unit ID separated by a dash"),
  latitude FLOAT64 OPTIONS(description="Latitude of the address"),
  longitude FLOAT64 OPTIONS(description="Longitude of the address")
);

INSERT INTO `bigquery-public-data.san_francisco.sffd_service_calls` (call_number, unit_id, incident_number, call_type, call_date, watch_date, received_timestamp, entry_timestamp, dispatch_timestamp, response_timestamp, on_scene_timestamp, transport_timestamp, hospital_timestamp, call_final_disposition, available_timestamp, address, city, zipcode_of_incident, battalion, station_area, box, original_priority, priority, final_priority, als_unit, call_type_group, number_of_alarms, unit_type, unit_sequence_in_call_dispatch, fire_prevention_district, supervisor_district, neighborhood_district, location, row_id, latitude, longitude) VALUES (122570160, 'KM10', 12084932, 'Medical Incident', '2012-09-13', '2012-09-13', '2012-09-13 12:44:55+00:00', '2012-09-13 12:46:22+00:00', '2012-09-13 12:46:33+00:00', '2012-09-13 12:47:18+00:00', '2012-09-13 13:01:09+00:00', '2012-09-13 13:16:59+00:00', '2012-09-13 13:37:24+00:00', 'Patient Declined Transport', '2012-09-13 13:37:44+00:00', '600 Block of MERCHANT ST', 'SF', '94111', 'B01', '13', '0124', '1', '1', 2, False, 'Non Life-threatening', 1, 'PRIVATE', 1, '1', '3', '', '(37.7949086758744, -122.404037735679)', '122570160-KM10', 37.7949086758744, -122.404037735679), (2510051, 'M28', 75063, 'Medical Incident', '2000-09-07', '2000-09-06', '2000-09-07 06:45:27+00:00', '2000-09-07 06:46:31+00:00', '2000-09-07 06:47:13+00:00', '2000-09-07 06:49:50+00:00', '2000-09-07 07:00:59+00:00', 'NaT', 'NaT', 'Other', '2000-09-07 07:25:42+00:00', '400 Block of FILBERT ST', 'SF', '94133', 'B01', '28', '0126', '1', '1', 2, True, '', 1, 'MEDIC', 1, '1', '3', '', '(37.8018046785455, -122.406418120773)', '002510051-M28', 37.8018046785455, -122.406418120773), (32050385, 'M28', 3059082, 'Medical Incident', '2003-07-24', '2003-07-24', '2003-07-24 21:14:34+00:00', '2003-07-24 21:16:03+00:00', '2003-07-24 21:16:29+00:00', '2003-07-24 21:17:53+00:00', '2003-07-24 21:19:52+00:00', 'NaT', 'NaT', 'Other', '2003-07-24 21:23:24+00:00', '2200 Block of POWELL ST', 'SF', '94133', 'B01', '28', '0131', '1', '1', 2, True, '', 1, 'MEDIC', 1, '1', '3', '', '(37.8055846438693, -122.411972668154)', '032050385-M28', 37.8055846438693, -122.411972668154), (12780403, 'M13', 1085363, 'Medical Incident', '2001-10-05', '2001-10-05', '2001-10-05 22:19:34+00:00', '2001-10-05 22:19:51+00:00', '2001-10-05 22:20:07+00:00', '2001-10-05 22:20:47+00:00', '2001-10-05 22:26:56+00:00', '2001-10-05 22:35:58+00:00', '2001-10-05 22:53:54+00:00', 'Other', '2001-10-05 23:07:47+00:00', '2300 Block of POWELL ST', 'SF', '94133', 'B01', '28', '0131', '1', '1', 2, True, '', 1, 'MEDIC', 1, '1', '3', '', '(37.8062826874223, -122.412114085659)', '012780403-M13', 37.8062826874223, -122.412114085659), (12240329, 'M28', 1069433, 'Medical Incident', '2001-08-12', '2001-08-12', '2001-08-12 23:02:27+00:00', '2001-08-12 23:04:00+00:00', '2001-08-12 23:04:10+00:00', '2001-08-12 23:05:29+00:00', '2001-08-12 23:08:12+00:00', 'NaT', 'NaT', 'Other', '2001-08-12 23:42:04+00:00', '2300 Block of POWELL ST', 'SF', '94133', 'B01', '28', '0131', '1', '1', 2, True, '', 1, 'MEDIC', 1, '1', '3', '', '(37.8062826874223, -122.412114085659)', '012240329-M28', 37.8062826874223, -122.412114085659);