SELECT day, month, year, species FROM surveys;
SELECT * FROM surveys;
SELECT DISTINCT year FROM surveys;
SELECT * FROM surveys WHERE species="DM";
SELECT * FROM surveys WHERE (year >= 2000) AND (species = "DM");
SELECT * FROM species ORDER BY Genus ASC;
SELECT * FROM species ORDER BY Genus DESC;
SELECT * FROM species ORDER BY genus ASC, species ASC;
Get the combined mass of all individuals in each year.
SELECT year, SUM(wgt)
FROM surveys
GROUP BY year;
SELECT surveys.year, surveys.month, surveys.day, species.genus, species.species
FROM surveys
JOIN species ON surveys.species = species.species_id
SELECT surveys.year, species.genus, species.species, SUM(wgt / 1000.0)
FROM surveys
JOIN species ON surveys.species = species.species_id
WHERE species.taxa="Rodent"
GROUP BY surveys.year, species.genus, species.species