1 |
12221
|
aaronmk
|
--
|
2 |
|
|
-- PostgreSQL database dump
|
3 |
|
|
--
|
4 |
|
|
|
5 |
|
|
SET statement_timeout = 0;
|
6 |
|
|
SET lock_timeout = 0;
|
7 |
|
|
SET client_encoding = 'UTF8';
|
8 |
|
|
SET standard_conforming_strings = on;
|
9 |
|
|
SET check_function_bodies = false;
|
10 |
|
|
SET client_min_messages = warning;
|
11 |
|
|
|
12 |
|
|
SET search_path = bien2_traits, pg_catalog;
|
13 |
|
|
|
14 |
|
|
--
|
15 |
12224
|
aaronmk
|
-- Name: _traits_01_count_records; Type: VIEW; Schema: bien2_traits; Owner: -
|
16 |
12221
|
aaronmk
|
--
|
17 |
|
|
|
18 |
12224
|
aaronmk
|
CREATE VIEW _traits_01_count_records AS
|
19 |
12286
|
aaronmk
|
SELECT count(*) AS "totalRecords"
|
20 |
12221
|
aaronmk
|
FROM "TraitObservation"
|
21 |
|
|
WHERE (((("TraitObservation"."taxonName" IS NOT NULL) AND ("TraitObservation"."taxonName" <> ''::text)) AND ("TraitObservation"."measurementName" IS NOT NULL)) AND ("TraitObservation"."measurementName" <> ''::text));
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
--
|
25 |
12224
|
aaronmk
|
-- Name: _traits_02_count_trait_names; Type: VIEW; Schema: bien2_traits; Owner: -
|
26 |
12221
|
aaronmk
|
--
|
27 |
|
|
|
28 |
12224
|
aaronmk
|
CREATE VIEW _traits_02_count_trait_names AS
|
29 |
12221
|
aaronmk
|
SELECT count(DISTINCT "TraitObservation"."measurementName") AS traits
|
30 |
|
|
FROM "TraitObservation"
|
31 |
|
|
WHERE (((("TraitObservation"."taxonName" IS NOT NULL) AND ("TraitObservation"."taxonName" <> ''::text)) AND ("TraitObservation"."measurementName" IS NOT NULL)) AND ("TraitObservation"."measurementName" <> ''::text));
|
32 |
|
|
|
33 |
|
|
|
34 |
|
|
--
|
35 |
12224
|
aaronmk
|
-- Name: _traits_03_list_trait_names; Type: VIEW; Schema: bien2_traits; Owner: -
|
36 |
12221
|
aaronmk
|
--
|
37 |
|
|
|
38 |
12224
|
aaronmk
|
CREATE VIEW _traits_03_list_trait_names AS
|
39 |
12221
|
aaronmk
|
SELECT DISTINCT "TraitObservation"."measurementName" AS trait
|
40 |
|
|
FROM "TraitObservation"
|
41 |
|
|
WHERE (((("TraitObservation"."taxonName" IS NOT NULL) AND ("TraitObservation"."taxonName" <> ''::text)) AND ("TraitObservation"."measurementName" IS NOT NULL)) AND ("TraitObservation"."measurementName" <> ''::text))
|
42 |
|
|
ORDER BY "TraitObservation"."measurementName";
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
--
|
46 |
12224
|
aaronmk
|
-- Name: _traits_04_count_records_per_trait; Type: VIEW; Schema: bien2_traits; Owner: -
|
47 |
12221
|
aaronmk
|
--
|
48 |
|
|
|
49 |
12224
|
aaronmk
|
CREATE VIEW _traits_04_count_records_per_trait AS
|
50 |
12221
|
aaronmk
|
SELECT "TraitObservation"."measurementName" AS trait,
|
51 |
|
|
count(*) AS measurements
|
52 |
|
|
FROM "TraitObservation"
|
53 |
|
|
WHERE (((("TraitObservation"."taxonName" IS NOT NULL) AND ("TraitObservation"."taxonName" <> ''::text)) AND ("TraitObservation"."measurementName" IS NOT NULL)) AND ("TraitObservation"."measurementName" <> ''::text))
|
54 |
|
|
GROUP BY "TraitObservation"."measurementName"
|
55 |
|
|
ORDER BY "TraitObservation"."measurementName";
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
--
|
59 |
12224
|
aaronmk
|
-- Name: _traits_05_count_taxa; Type: VIEW; Schema: bien2_traits; Owner: -
|
60 |
12221
|
aaronmk
|
--
|
61 |
|
|
|
62 |
12224
|
aaronmk
|
CREATE VIEW _traits_05_count_taxa AS
|
63 |
12246
|
aaronmk
|
SELECT count(DISTINCT btrim(concat_ws(' '::text, ifnull("TraitObservation"."taxonName", ''::text), ifnull("TraitObservation"."scientificNameAuthorship", ''::text)))) AS taxa
|
64 |
12221
|
aaronmk
|
FROM "TraitObservation"
|
65 |
|
|
WHERE (((("TraitObservation"."taxonName" IS NOT NULL) AND ("TraitObservation"."taxonName" <> ''::text)) AND ("TraitObservation"."measurementName" IS NOT NULL)) AND ("TraitObservation"."measurementName" <> ''::text));
|
66 |
|
|
|
67 |
|
|
|
68 |
|
|
--
|
69 |
12224
|
aaronmk
|
-- Name: _traits_06_list_distinct_taxa; Type: VIEW; Schema: bien2_traits; Owner: -
|
70 |
12221
|
aaronmk
|
--
|
71 |
|
|
|
72 |
12224
|
aaronmk
|
CREATE VIEW _traits_06_list_distinct_taxa AS
|
73 |
12246
|
aaronmk
|
SELECT DISTINCT btrim(concat_ws(' '::text, ifnull("TraitObservation"."taxonName", ''::text), ifnull("TraitObservation"."scientificNameAuthorship", ''::text))) AS taxonwithauthor
|
74 |
12221
|
aaronmk
|
FROM "TraitObservation"
|
75 |
|
|
WHERE (((("TraitObservation"."taxonName" IS NOT NULL) AND ("TraitObservation"."taxonName" <> ''::text)) AND ("TraitObservation"."measurementName" IS NOT NULL)) AND ("TraitObservation"."measurementName" <> ''::text))
|
76 |
12246
|
aaronmk
|
ORDER BY btrim(concat_ws(' '::text, ifnull("TraitObservation"."taxonName", ''::text), ifnull("TraitObservation"."scientificNameAuthorship", ''::text)));
|
77 |
12221
|
aaronmk
|
|
78 |
|
|
|
79 |
|
|
--
|
80 |
12224
|
aaronmk
|
-- Name: _traits_07_trait_value_and_units; Type: VIEW; Schema: bien2_traits; Owner: -
|
81 |
12221
|
aaronmk
|
--
|
82 |
|
|
|
83 |
12224
|
aaronmk
|
CREATE VIEW _traits_07_trait_value_and_units AS
|
84 |
12221
|
aaronmk
|
SELECT "TraitObservation"."measurementName" AS trait,
|
85 |
|
|
"TraitObservation"."measurementValue" AS value,
|
86 |
|
|
"TraitObservation"."measurementUnit" AS units
|
87 |
|
|
FROM "TraitObservation"
|
88 |
|
|
WHERE (((("TraitObservation"."taxonName" IS NOT NULL) AND ("TraitObservation"."taxonName" <> ''::text)) AND ("TraitObservation"."measurementName" IS NOT NULL)) AND ("TraitObservation"."measurementName" <> ''::text))
|
89 |
|
|
ORDER BY "TraitObservation"."measurementName", "TraitObservation"."measurementValue", "TraitObservation"."measurementUnit";
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
--
|
93 |
12367
|
aaronmk
|
-- Name: _traits_08_taxonname_trait_and_value; Type: VIEW; Schema: bien2_traits; Owner: -
|
94 |
12221
|
aaronmk
|
--
|
95 |
|
|
|
96 |
12367
|
aaronmk
|
CREATE VIEW _traits_08_taxonname_trait_and_value AS
|
97 |
12246
|
aaronmk
|
SELECT btrim(concat_ws(' '::text, ifnull("TraitObservation"."taxonName", ''::text), ifnull("TraitObservation"."scientificNameAuthorship", ''::text))) AS taxonwithauthor,
|
98 |
12221
|
aaronmk
|
"TraitObservation"."measurementName" AS trait,
|
99 |
|
|
"TraitObservation"."measurementValue" AS value
|
100 |
|
|
FROM "TraitObservation"
|
101 |
|
|
WHERE (((("TraitObservation"."taxonName" IS NOT NULL) AND ("TraitObservation"."taxonName" <> ''::text)) AND ("TraitObservation"."measurementName" IS NOT NULL)) AND ("TraitObservation"."measurementName" <> ''::text))
|
102 |
12246
|
aaronmk
|
ORDER BY btrim(concat_ws(' '::text, ifnull("TraitObservation"."taxonName", ''::text), ifnull("TraitObservation"."scientificNameAuthorship", ''::text))), "TraitObservation"."measurementName", "TraitObservation"."measurementValue";
|
103 |
12221
|
aaronmk
|
|
104 |
|
|
|
105 |
|
|
--
|
106 |
|
|
-- PostgreSQL database dump complete
|
107 |
|
|
--
|