-- DBMS: bigquery
CREATE TABLE `bigquery-public-data.new_york.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.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 (242259, 111782, '2015-09-20', 5, 0, 'OffsetFromCurb', 'Dead', '', '', '', '', '', '', 'Volunteer', '', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', '991 5 AVENUE', 83, 'Central Park', 108, 1, 'Manhattan', 6, 69, 29, 'MN40', 'Upper East Side-Carnegie Hill', 1014300, 'New York', 40.77784648, -73.96324124, 994430.5974, 222669.4113), (407391, 111770, '2015-10-31', 4, 0, 'OffsetFromCurb', 'Dead', '', '', '', '', '', '', 'Volunteer', '', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', '871 5 AVENUE', 83, 'Central Park', 108, 1, 'Manhattan', 6, 75, 29, 'MN40', 'Upper East Side-Carnegie Hill', 1014300, 'New York', 40.77009288, -73.96890291, 992863.5612, 219843.9081), (216053, 304155, '2015-09-11', 8, 0, 'OnCurb', 'Dead', '', '', '', '', '', '', 'Volunteer', '', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', '46-020 39 AVENUE', 11104, 'Sunnyside', 402, 4, 'Queens', 26, 37, 12, 'QN31', 'Hunters Point-Sunnyside-West Maspeth', 4016900, 'New York', 40.74920717, -73.91678727, 1007306.261, 212243.983), (372922, 304138, '2015-10-24', 5, 0, 'OnCurb', 'Dead', '', '', '', '', '', '', 'Volunteer', '', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', '39-003 GOSMAN AVENUE', 11104, 'Sunnyside', 402, 4, 'Queens', 26, 30, 12, 'QN31', 'Hunters Point-Sunnyside-West Maspeth', 4016900, 'New York', 40.74893152, -73.91555844, 1007646.837, 212143.8825), (29179, 303241, '2015-06-22', 5, 0, 'OnCurb', 'Dead', '', '', '', '', '', '', 'Volunteer', '', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', '47-051 40 STREET', 11104, 'Sunnyside', 402, 4, 'Queens', 26, 37, 12, 'QN31', 'Hunters Point-Sunnyside-West Maspeth', 4018502, 'New York', 40.74041546, -73.92487671, 1005067.616, 209038.8579);