-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocs.window-functions.sql
More file actions
101 lines (81 loc) · 3.21 KB
/
procs.window-functions.sql
File metadata and controls
101 lines (81 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
-- FIDATA. Open-source system for analysis of financial and economic data
-- Copyright © 2012-2013 Basil Peace
/*
This file is part of FIDATA.
FIDATA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FIDATA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FIDATA. If not, see <http://www.gnu.org/licenses/>.
*/
-------------------------------------------------------------------------------
-- WINDOW FUNCTIONS --
-------------------------------------------------------------------------------
INSERT INTO procs.procs (name, proc_type, dbms_proc_namespace, dbms_proc, output_type, description) VALUES
('Count', 'window_func', NULL, 'count', 'pieces', ''),
-- ('Mo', 'window_func', NULL, '', NULL, ''),
-- ('Qntl', 'window_func', NULL, '', NULL, ''),
-- ('Me', 'window_func', NULL, '', NULL, ''),
('Max', 'window_func', NULL, 'max', NULL, ''),
('Min', 'window_func', NULL, 'min', NULL, ''),
('Mean', 'window_func', NULL, 'avg', NULL, ''),
('Var', 'window_func', NULL, 'var_samp', NULL, ''), -- TODO: output_type is price_type^2
('StdDev', 'window_func', NULL, 'stddev_samp', NULL, '') -- TODO: use c4 coefficient
-- ('Skew', 'window_func', NULL, '', 'ratio', ''),
-- ('Kurt', 'window_func', NULL, '', 'ratio', ''),
-- ('Ex', 'window_func', NULL, '', 'ratio', ''),
-- ('GMean' 'window_func', NULL, '', NULL, '')
;
INSERT INTO procs.proc_input_scales (proc, scale) VALUES
/*
('Mo', 'Nominal' ),
('Mo', 'Ordinal' ),
('Mo', 'Interval'),
('Mo', 'Ratio' ),
('Mo', 'Absolute'),
('Qntl', 'Ordinal' ),
('Qntl', 'Interval'),
('Qntl', 'Ratio' ),
('Qntl', 'Absolute'),
('Me', 'Ordinal' ),
('Me', 'Interval'),
('Me', 'Ratio' ),
('Me', 'Absolute'),
*/
('Max', 'Ordinal' ),
('Max', 'Interval'),
('Max', 'Ratio' ),
('Max', 'Absolute'),
('Min', 'Ordinal' ),
('Min', 'Interval'),
('Min', 'Ratio' ),
('Min', 'Absolute'),
('Mean', 'Interval'),
('Mean', 'Ratio' ),
('Mean', 'Absolute'),
('Var', 'Interval'),
('Var', 'Ratio' ),
('Var', 'Absolute'),
('StdDev', 'Interval'),
('StdDev', 'Ratio' ),
('StdDev', 'Absolute')
/*
('Skew', 'Interval'),
('Skew', 'Ratio' ),
('Skew', 'Absolute'),
('Kurt', 'Interval'),
('Kurt', 'Ratio' ),
('Kurt', 'Absolute'),
('Ex', 'Interval'),
('Ex', 'Ratio' ),
('Ex', 'Absolute'),
('GMean', 'Ratio' ),
('GMean', 'Absolute')
*/
;
-------------------------------------------------------------------------------