Project

General

Profile

1
SELECT '# projects' AS ___;
2
SELECT count(*) AS count FROM project;
3

    
4
SELECT 'projects' AS ___;
5
SELECT projectname AS project FROM project ORDER BY project;
6

    
7
SELECT E'each project\'s # locations' AS ___;
8
SELECT projectname AS project, count(*) AS locations_count
9
FROM project
10
JOIN locationevent USING (project_id)
11
GROUP BY project
12
ORDER BY project
13
;
14

    
15
SELECT '# locations' AS ___;
16
SELECT count(*) AS count FROM location;
17

    
18
SELECT '# location events' AS ___;
19
SELECT count(*) AS count FROM locationevent;
20

    
21
SELECT '1st methods' AS ___;
22
SELECT DISTINCT
23
    projectname AS project
24
    , plotmethod.name AS method
25
FROM project
26
JOIN locationevent USING (project_id)
27
JOIN plotmethod USING (plotmethod_id)
28
ORDER BY project, method
29
LIMIT 10;
30

    
31
SELECT '1st observation measures' AS ___;
32
SELECT DISTINCT
33
    projectname AS project
34
    , method.observationmeasure AS observationmeasure
35
FROM project
36
JOIN locationevent USING (project_id)
37
JOIN plotmethod USING (plotmethod_id)
38
JOIN method USING (method_id)
39
ORDER BY project, observationmeasure
40
LIMIT 10;
(3-3/3)