-- DBMS: bigquery
CREATE TABLE `bigquery-public-data.new_york_trees.tree_census_2015`
(
  tree_id INT64 NOT NULL OPTIONS(description="Unique identification number for each tree point"),
  block_id INT64 OPTIONS(description="Identifier linking each tree to the block in the blockface table/shapefile that it is mapped on."),
  created_at DATE OPTIONS(description="The date tree points were collected in the census software"),
  tree_dbh INT64 OPTIONS(description="Diameter of the tree, measured at approximately 54\" / 137cm above the ground."),
  stump_diam INT64 OPTIONS(description="Diameter of stump measured through the center, rounded to the nearest inch."),
  curb_loc STRING OPTIONS(description="Location of tree bed in relationship to the curb; trees are either along the curb (OnCurb) or offset from the curb (OffsetFromCurb)"),
  status STRING OPTIONS(description="Indicates whether the tree is alive, standing dead, or a stump."),
  health STRING OPTIONS(description="Indicates the user's perception of tree health."),
  spc_latin STRING OPTIONS(description="Scientific name for species, e.g. \"Acer rubrum\""),
  spc_common STRING OPTIONS(description="Common name for species, e.g. \"red maple\""),
  steward STRING OPTIONS(description="Indicates the number of unique signs of stewardship observed for this tree. Not recorded for stumps or dead trees."),
  guards STRING OPTIONS(description="Indicates whether a guard is present, and if the user felt it was a helpful or harmful guard. Not recorded for dead trees and stumps"),
  sidewalk STRING OPTIONS(description="Indicates whether one of the sidewalk flags immediately adjacent to the tree was damaged, cracked, or lifted. Not recorded for dead trees and stumps."),
  user_type STRING OPTIONS(description="This field describes the category of user who collected this tree point's data."),
  problems STRING OPTIONS(description=""),
  root_stone STRING OPTIONS(description="Indicates the presence of a root problem caused by paving stones in tree bed"),
  root_grate STRING OPTIONS(description="Indicates the presence of a root problem caused by metal grates in tree bed"),
  root_other STRING OPTIONS(description="Indicates the presence of other root problems"),
  trunk_wire STRING OPTIONS(description="Indicates the presence of a trunk problem caused by wires or rope wrapped around the trunk"),
  trnk_light STRING OPTIONS(description="Indicates the presence of a trunk problem caused by lighting installed on the tree"),
  trnk_other STRING OPTIONS(description="Indicates the presence of other trunk problems"),
  brch_light STRING OPTIONS(description="Indicates the presence of a branch problem caused by lights (usually string lights) or wires in the branches"),
  brch_shoe STRING OPTIONS(description="Indicates the presence of a branch problem caused by sneakers in the branches"),
  brch_other STRING OPTIONS(description="Indicates the presence of other branch problems"),
  address STRING OPTIONS(description="Nearest estimated address to tree"),
  zipcode INT64 OPTIONS(description="Five-digit zipcode in which tree is located"),
  zip_city STRING OPTIONS(description="City as derived from zipcode. This is often (but not always) the same as borough."),
  cb_num INT64 OPTIONS(description="Community board in which tree point is located"),
  borocode INT64 OPTIONS(description="Code for borough in which tree point is located"),
  boroname STRING OPTIONS(description="Name of borough in which tree point is located"),
  cncldist INT64 OPTIONS(description="Council district in which tree point is located"),
  st_assem INT64 OPTIONS(description="State Assembly District in which tree point is located"),
  st_senate INT64 OPTIONS(description="State Senate District in which tree point is located"),
  nta STRING OPTIONS(description="This is the NTA Code corresponding to the neighborhood tabulation area from the 2010 US Census that the tree point falls into."),
  nta_name STRING OPTIONS(description="This is the NTA name corresponding to the neighborhood tabulation area from the 2010 US Census that the tree point falls into."),
  boro_ct INT64 OPTIONS(description="This is the boro_ct identifyer for the census tract that the tree point falls into."),
  state STRING OPTIONS(description="All features given value 'New York'"),
  latitude FLOAT64 OPTIONS(description="Latitude of point, in decimal degrees"),
  longitude FLOAT64 OPTIONS(description="Longitude of point, in decimal degrees"),
  x_sp FLOAT64 OPTIONS(description="X coordinate, in state plane. Units are feet."),
  y_sp FLOAT64 OPTIONS(description="Y coordinate, in state plane. Units are feet")
);

INSERT INTO `bigquery-public-data.new_york_trees.tree_census_2015` (tree_id, block_id, created_at, tree_dbh, stump_diam, curb_loc, status, health, spc_latin, spc_common, steward, guards, sidewalk, user_type, problems, root_stone, root_grate, root_other, trunk_wire, trnk_light, trnk_other, brch_light, brch_shoe, brch_other, address, zipcode, zip_city, cb_num, borocode, boroname, cncldist, st_assem, st_senate, nta, nta_name, boro_ct, state, latitude, longitude, x_sp, y_sp) VALUES (80548, 502982, '2015-07-20', 0, 16, 'OnCurb', 'Stump', NULL, NULL, NULL, NULL, NULL, NULL, 'Volunteer', NULL, 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', '192 EAST 164 STREET', 10451, 'Bronx', 204, 2, 'Bronx', 8, 77, 32, 'BX14', 'East Concourse-Concourse Village', 2018301, 'New York', 40.82914287, -73.91992682, 1006409.745, 241366.4842), (449489, 503216, '2015-11-12', 0, 4, 'OnCurb', 'Stump', NULL, NULL, NULL, NULL, NULL, NULL, 'NYC Parks Staff', NULL, 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', '1007 SUMMIT AVENUE', 10452, 'Bronx', 204, 2, 'Bronx', 8, 77, 29, 'BX26', 'Highbridge', 2018900, 'New York', 40.83350388, -73.93009592, 1003594.243, 242952.9505), (449293, 503196, '2015-11-12', 0, 5, 'OnCurb', 'Stump', NULL, NULL, NULL, NULL, NULL, NULL, 'NYC Parks Staff', NULL, 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', '80 WEST 163 STREET', 10452, 'Bronx', 204, 2, 'Bronx', 8, 84, 29, 'BX26', 'Highbridge', 2018900, 'New York', 40.83204635, -73.92889374, 1003927.349, 242422.1871), (449153, 503188, '2015-11-12', 0, 10, 'OnCurb', 'Stump', NULL, NULL, NULL, NULL, NULL, NULL, 'NYC Parks Staff', NULL, 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', '1012 NELSON AVENUE', 10452, 'Bronx', 204, 2, 'Bronx', 8, 84, 29, 'BX26', 'Highbridge', 2018900, 'New York', 40.8330926, -73.92845135, 1004049.461, 242803.4738), (449148, 503152, '2015-11-12', 0, 5, 'OnCurb', 'Stump', NULL, NULL, NULL, NULL, NULL, NULL, 'NYC Parks Staff', NULL, 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', '997 OGDEN AVENUE', 10452, 'Bronx', 204, 2, 'Bronx', 8, 84, 29, 'BX26', 'Highbridge', 2018900, 'New York', 40.83284025, -73.92951005, 1003756.562, 242711.2955);