# Example of how to add a missing code to an existing DBHMEasurement in  a CTFS database
# Shameema Esufali revised June 2020

# *******************************************************************************************************
# ***** CREATE LOG RECORDS FOR EACH TABLE YOU ARE INSERTING INTO
#  Note: You should be able to use this code without any changes 
#  except the description or reason for insert.
# *******************************************************************************************************
-- **********************************************************************************************
# This part sets up the test database.  You must replace it with a USE current_yoursite;
DROP DATABASE IF EXISTS blue;
CREATE DATABASE IF NOT EXISTS blue;
USE blue;
SOURCE ../sampledatabases/blue.sql;
-- end test database setup **********************************************************************



/* 
Typical values for the essential columns in this table. 
PlotID              Automatically generated.  Leave null. 
PlotName            Short one word name in lower case is recommended  eg "sinharaja"
LocationName        Longer descriptive name or location "Sinharaja Forest Reserve" 
CountryID           What it is in the country table
ShapeOfSite         LengthXwidth in meters  eg 1000x500
DescriptionOfSite   Description eg Wet Lowland Dipterocarp forest
Area                Area of plot in hectares eg. 25
QdimX               Quadrat dimension in Meters  eg. 20
QdimY               Quadrat dimension in Meters  eg. 20

Global Units of Measure for each axis  typically M (metre)
*/



INSERT INTO Site(PlotID, PlotName, LocationName, CountryID, ShapeOfSite, DescriptionOfSite, Area, QDimX, QDimY, GUOM, GZUOM, PUOM, QUOM)) VALUES (null,'plotname', 'locationname', 1, '500x1000','your description' ,50, 20,20, 'M','M','M','M');


UPDATE Site SET LocationName = "Barro Colorado Island" WHERE plotname="bci";





