# Checksum.sql 
# Created by Shameema Esufali 12th November 2013

 select count(*), sum(Tag), sum(SpeciesID) from Tree;
 select count(*),sum(stemtag) from Stem;
 select count(*),sum(dbh),sum(exactdate) from DBH;
 select count(*) from DBHAttributes; 
 select ChangedTable,ChangedColumn,ChangeDate, count(*) from Log group by ChangedTable,ChangedColumn, ChangeDate;
 select count(*),sum(speciesid), count(distinct mnemonic),count(distinct idlevel),count(distinct speciesname) from Species;
 select count(*),sum(tag),Sum(DBH),sum(exactdate),censusid from ViewFullTable group by censusid;
 
 
 
 
 
 
 /* For old versions of the database
 select count(*), sum(Tag), sum(SpeciesID) from Tree;
 select count(*),sum(stemtag) from Stem;
 select count(*),sum(dbh),sum(exactdate) from Measurement;
 select count(*) from MeasurementAttributes;
  select DescriptionofChange,Dateofchange, count(*) from TreeHistory group by Descriptionofchange,dateofchange;
 select DescriptionofChange,Dateofchange, count(*) from StemHistory group by Descriptionofchange,dateofchange;
 select DescriptionofChange,Dateofchange, count(*) from MeasurementHistory group by Descriptionofchange,dateofchange;
 select DescriptionofChange,Dateofchange, count(*) from MeasurementAttrHistory group by Descriptionofchange,dateofchange;
 select count(*),sum(speciesid), count(distinct mnemonic),count(distinct idlevel),count(distinct speciesname) from Species;
 select count(*),sum(tag),Sum(DBH),sum(exactdate),censusid from DFtemp group by censusid;
 */
