DB Queries
DB Queries
Query: Display the total number of observations by species with total number greater than 4
SELECT s.en_name as english_name, s.lat_name as latin_name, sum(o.nb) as total
FROM species s, observed o
WHERE o.spid=s.spid
GROUP BY s.en_name, s.lat_name
HAVING SUM(o.nb)>4
ORDER BY total desc
Query: Give details on Gorilla (The name, the date, the number of individuals observed, and the
observer)
SELECT s.en_name, o.date, o.nb, a.names
FROM species s, agents a, observed o
WHERE s.spid=o.spid and a.id=o.id and s.en_name='Gorilla'