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
|
WHERE parent_id IS NULL -- no subplots
|
18
|
;
|
19
|
|
20
|
SELECT '# location events' AS ___;
|
21
|
SELECT count(*) AS count FROM locationevent
|
22
|
WHERE parent_id IS NULL -- no subplots
|
23
|
;
|
24
|
|
25
|
SELECT '1st methods' AS ___;
|
26
|
SELECT DISTINCT
|
27
|
projectname AS project
|
28
|
, method.name AS method
|
29
|
FROM project
|
30
|
JOIN locationevent USING (project_id)
|
31
|
JOIN method USING (method_id)
|
32
|
ORDER BY project, method
|
33
|
LIMIT 10;
|
34
|
|
35
|
SELECT '1st observation measures' AS ___;
|
36
|
SELECT DISTINCT
|
37
|
projectname AS project
|
38
|
, method.observationmeasure AS observationmeasure
|
39
|
FROM project
|
40
|
JOIN locationevent USING (project_id)
|
41
|
JOIN method USING (method_id)
|
42
|
ORDER BY project, observationmeasure
|
43
|
LIMIT 10;
|