Revision 12187
Added by Aaron Marcuse-Kubitza about 11 years ago
trunk/validation/aggregating/traits/BIEN2_traits/bien3_validations_traits_original_mysql.VegCore.sql | ||
---|---|---|
1 | 1 |
-- ------------------------------------------------------------------------------- |
2 | 2 |
-- Quantitative validation queries against the trait table in db bien2 on nimoy |
3 |
--
|
|
3 |
-- |
|
4 | 4 |
-- For all queries, omit records where taxon or traitName are null or blank |
5 | 5 |
-- This filtering would have been performed prior to import |
6 | 6 |
-- ------------------------------------------------------------------------------- |
... | ... | |
45 | 45 |
-- ------------------ |
46 | 46 |
-- 5. Count taxa |
47 | 47 |
-- ------------------ |
48 |
SELECT COUNT(DISTINCT
|
|
48 |
SELECT COUNT(DISTINCT |
|
49 | 49 |
TRIM(CONCAT_WS(' ',IFNULL("taxonName",''),IFNULL("scientificNameAuthorship",''))) |
50 | 50 |
) AS taxa |
51 | 51 |
FROM "TraitObservation" |
... | ... | |
55 | 55 |
-- ------------------ |
56 | 56 |
-- 6. List distinct taxa |
57 | 57 |
-- ------------------ |
58 |
SELECT DISTINCT
|
|
58 |
SELECT DISTINCT |
|
59 | 59 |
TRIM(CONCAT_WS(' ',IFNULL("taxonName",''),IFNULL("scientificNameAuthorship",''))) |
60 | 60 |
AS taxonwithauthor |
61 | 61 |
FROM "TraitObservation" |
... | ... | |
64 | 64 |
; |
65 | 65 |
|
66 | 66 |
-- ------------------ |
67 |
-- 7. Trait, value and units
|
|
67 |
-- 7. Trait, value and units |
|
68 | 68 |
-- ------------------ |
69 | 69 |
SELECT "measurementName" AS trait, "measurementValue" AS value, "measurementUnit" AS units |
70 | 70 |
FROM "TraitObservation" |
... | ... | |
73 | 73 |
; |
74 | 74 |
|
75 | 75 |
-- ------------------ |
76 |
-- 8. "taxonName", trait and value for first 5000 records
|
|
76 |
-- 8. "taxonName", trait and value for first 5000 records |
|
77 | 77 |
-- ------------------ |
78 |
SELECT
|
|
78 |
SELECT |
|
79 | 79 |
TRIM(CONCAT_WS(' ',IFNULL("taxonName",''),IFNULL("scientificNameAuthorship",''))) |
80 | 80 |
AS taxonwithauthor, |
81 | 81 |
"measurementName" AS trait, "measurementValue" AS "value" |
Also available in: Unified diff
validation/aggregating/traits/BIEN2_traits/bien3_validations_traits_original_mysql.VegCore.sql: removed trailing whitespace