Project

General

Profile

1 1243 aaronmk
SELECT '# specimen replicates' AS ___;
2
SELECT count(*) AS count
3
FROM specimenreplicate
4 6179 aaronmk
WHERE source_id =
5
    (SELECT source_id FROM source WHERE shortname = :datasource)
6 1243 aaronmk
;
7
8
SELECT '# families' AS ___;
9 5974 aaronmk
SELECT count(DISTINCT family) AS count
10
FROM taxonlabel
11
JOIN taxonverbatim USING (taxonlabel_id)
12 6179 aaronmk
WHERE source_id =
13
    (SELECT source_id FROM source WHERE shortname = :datasource)
14 1243 aaronmk
;
15 1246 aaronmk
16
SELECT '# genera' AS ___;
17 5974 aaronmk
SELECT count(DISTINCT genus) AS count
18
FROM taxonlabel
19
JOIN taxonverbatim USING (taxonlabel_id)
20 6179 aaronmk
WHERE source_id =
21
    (SELECT source_id FROM source WHERE shortname = :datasource)
22 1246 aaronmk
;
23
24
SELECT '# species' AS ___;
25 5974 aaronmk
SELECT count(DISTINCT specific_epithet) AS count
26
FROM taxonlabel
27
JOIN taxonverbatim USING (taxonlabel_id)
28 6179 aaronmk
WHERE source_id =
29
    (SELECT source_id FROM source WHERE shortname = :datasource)
30 1246 aaronmk
;
31 1254 aaronmk
32
SELECT '# binomials' AS ___;
33 5974 aaronmk
SELECT count(DISTINCT taxonverbatim_id) AS count
34
FROM taxonlabel
35
JOIN taxonverbatim USING (taxonlabel_id)
36 6179 aaronmk
WHERE source_id =
37
    (SELECT source_id FROM source WHERE shortname = :datasource)
38 1254 aaronmk
;
39 1297 aaronmk
40
SELECT 'collection codes' AS ___;
41
SELECT DISTINCT collectioncode_dwc
42
FROM specimenreplicate
43 6179 aaronmk
WHERE source_id =
44
    (SELECT source_id FROM source WHERE shortname = :datasource)
45 1297 aaronmk
;
46
47
SELECT '# catalog numbers' AS ___;
48
SELECT count(DISTINCT catalognumber_dwc) AS count
49
FROM specimenreplicate
50 6179 aaronmk
WHERE source_id =
51
    (SELECT source_id FROM source WHERE shortname = :datasource)
52 1297 aaronmk
;
53 1298 aaronmk
54 1300 aaronmk
SELECT 'duplicate catalog numbers' AS ___;
55
SELECT catalognumber_dwc, count(*) AS count
56
FROM specimenreplicate
57 6179 aaronmk
WHERE source_id =
58
    (SELECT source_id FROM source WHERE shortname = :datasource)
59 1300 aaronmk
GROUP BY catalognumber_dwc
60
HAVING count(*) > 1
61 5974 aaronmk
ORDER BY catalognumber_dwc
62 1300 aaronmk
;
63
64 1298 aaronmk
SELECT '# counties' AS ___;
65 5974 aaronmk
SELECT count(DISTINCT county) AS count
66
FROM place
67 6179 aaronmk
WHERE source_id =
68
    (SELECT source_id FROM source WHERE shortname = :datasource)
69 1298 aaronmk
;