Project

General

Profile

1
SELECT '# specimen replicates' AS ___;
2
SELECT count(*) AS count
3
FROM specimenreplicate
4
WHERE source_id =
5
    (SELECT source_id FROM source WHERE shortname = :datasource)
6
;
7

    
8
SELECT '# families' AS ___;
9
SELECT count(DISTINCT family) AS count
10
FROM taxonlabel
11
JOIN taxonverbatim USING (taxonlabel_id)
12
WHERE source_id =
13
    (SELECT source_id FROM source WHERE shortname = :datasource)
14
;
15

    
16
SELECT '# genera' AS ___;
17
SELECT count(DISTINCT genus) AS count
18
FROM taxonlabel
19
JOIN taxonverbatim USING (taxonlabel_id)
20
WHERE source_id =
21
    (SELECT source_id FROM source WHERE shortname = :datasource)
22
;
23

    
24
SELECT '# species' AS ___;
25
SELECT count(DISTINCT specific_epithet) AS count
26
FROM taxonlabel
27
JOIN taxonverbatim USING (taxonlabel_id)
28
WHERE source_id =
29
    (SELECT source_id FROM source WHERE shortname = :datasource)
30
;
31

    
32
SELECT '# binomials' AS ___;
33
SELECT count(DISTINCT taxonverbatim_id) AS count
34
FROM taxonlabel
35
JOIN taxonverbatim USING (taxonlabel_id)
36
WHERE source_id =
37
    (SELECT source_id FROM source WHERE shortname = :datasource)
38
;
39

    
40
SELECT 'collection codes' AS ___;
41
SELECT DISTINCT collectioncode_dwc
42
FROM specimenreplicate
43
WHERE source_id =
44
    (SELECT source_id FROM source WHERE shortname = :datasource)
45
;
46

    
47
SELECT '# catalog numbers' AS ___;
48
SELECT count(DISTINCT catalognumber_dwc) AS count
49
FROM specimenreplicate
50
WHERE source_id =
51
    (SELECT source_id FROM source WHERE shortname = :datasource)
52
;
53

    
54
SELECT 'duplicate catalog numbers' AS ___;
55
SELECT catalognumber_dwc, count(*) AS count
56
FROM specimenreplicate
57
WHERE source_id =
58
    (SELECT source_id FROM source WHERE shortname = :datasource)
59
GROUP BY catalognumber_dwc
60
HAVING count(*) > 1
61
ORDER BY catalognumber_dwc
62
;
63

    
64
SELECT '# counties' AS ___;
65
SELECT count(DISTINCT county) AS count
66
FROM place
67
WHERE source_id =
68
    (SELECT source_id FROM source WHERE shortname = :datasource)
69
;
(16-16/16)