1 |
373
|
aaronmk
|
SELECT '# projects' AS ___;
|
2 |
371
|
aaronmk
|
SELECT count(*) AS count FROM project;
|
3 |
368
|
aaronmk
|
|
4 |
374
|
aaronmk
|
SELECT 'projects' AS ___;
|
5 |
|
|
SELECT projectname AS project FROM project ORDER BY project;
|
6 |
371
|
aaronmk
|
|
7 |
616
|
aaronmk
|
SELECT E'each project\'s # locations' AS ___;
|
8 |
|
|
SELECT projectname AS project, count(*) AS locations_count
|
9 |
371
|
aaronmk
|
FROM project
|
10 |
616
|
aaronmk
|
JOIN locationevent USING (project_id)
|
11 |
371
|
aaronmk
|
GROUP BY project
|
12 |
|
|
ORDER BY project
|
13 |
|
|
;
|
14 |
374
|
aaronmk
|
|
15 |
616
|
aaronmk
|
SELECT '# locations' AS ___;
|
16 |
1157
|
aaronmk
|
SELECT count(*) AS count FROM location
|
17 |
|
|
WHERE parent_id IS NULL -- no subplots
|
18 |
|
|
;
|
19 |
376
|
aaronmk
|
|
20 |
1083
|
aaronmk
|
SELECT '# location events' AS ___;
|
21 |
1157
|
aaronmk
|
SELECT count(*) AS count FROM locationevent
|
22 |
|
|
WHERE parent_id IS NULL -- no subplots
|
23 |
|
|
;
|
24 |
377
|
aaronmk
|
|
25 |
|
|
SELECT '1st methods' AS ___;
|
26 |
|
|
SELECT DISTINCT
|
27 |
|
|
projectname AS project
|
28 |
1156
|
aaronmk
|
, method.name AS method
|
29 |
377
|
aaronmk
|
FROM project
|
30 |
616
|
aaronmk
|
JOIN locationevent USING (project_id)
|
31 |
1156
|
aaronmk
|
JOIN method USING (method_id)
|
32 |
377
|
aaronmk
|
ORDER BY project, method
|
33 |
|
|
LIMIT 10;
|
34 |
|
|
|
35 |
1083
|
aaronmk
|
SELECT '1st observation measures' AS ___;
|
36 |
377
|
aaronmk
|
SELECT DISTINCT
|
37 |
|
|
projectname AS project
|
38 |
1083
|
aaronmk
|
, method.observationmeasure AS observationmeasure
|
39 |
377
|
aaronmk
|
FROM project
|
40 |
616
|
aaronmk
|
JOIN locationevent USING (project_id)
|
41 |
1083
|
aaronmk
|
JOIN method USING (method_id)
|
42 |
|
|
ORDER BY project, observationmeasure
|
43 |
377
|
aaronmk
|
LIMIT 10;
|