2 echo CREATE TABLE t1
(f1 SMALLINT
,f2 INT
,f3 BIGINT
,f4 FLOAT
,f5 DOUBLE
,f6 CHAR
(20),f7 DATE
,f8 TIME
,f9 TIMESTAMP
);
4 echo INSERT INTO t1 values
(1,111,11111111,1111.1111,1111111.111111,'AAAA','2001-01-01','01:01:01','2001-01-01 01:01:01');
5 Statement Executed
: Rows Affected
= 1
6 echo INSERT INTO t1 values
(2,222,22222222,2222.2222,2222222.222222,'BBBB','2002-02-02','02:02:02','2002-02-02 02:02:02');
7 Statement Executed
: Rows Affected
= 1
8 echo INSERT INTO t1 values
(4,444,44444444,4444.4444,4444444.444444,'CCCC','2004-04-04','04:04:04','2004-04-04 04:04:04');
9 Statement Executed
: Rows Affected
= 1
10 echo INSERT INTO t1 values
(3,333,33333333,3333.3333,3333333.333333,'CCCC','2003-03-03','03:03:03','2003-03-03 03:03:03');
11 Statement Executed
: Rows Affected
= 1
12 echo SELECT
* FROM t1
;
13 ---------------------------------------------------------
14 t1.f1 t1.f2 t1.f3 t1.f4 t1.f5 t1.f6 t1.f7 t1.f8 t1.f9
15 ---------------------------------------------------------
16 1 111 11111111 1111.111084 1111111.111111 AAAA
2001/1/1 1:1:1.0 2001/1/1 1:1:1.0
17 2 222 22222222 2222.222168 2222222.222222 BBBB
2002/2/2 2:2:2.0 2002/2/2 2:2:2.0
18 4 444 44444444 4444.444336 4444444.444444 CCCC
2004/4/4 4:4:4.0 2004/4/4 4:4:4.0
19 3 333 33333333 3333.333252 3333333.333333 CCCC
2003/3/3 3:3:3.0 2003/3/3 3:3:3.0
21 echo SELECT COUNT
(*) FROM t1
;
22 ---------------------------------------------------------
24 ---------------------------------------------------------
27 echo SELECT COUNT
(f1
) FROM t1
;
28 ---------------------------------------------------------
30 ---------------------------------------------------------
33 echo SELECT COUNT
(f2
) FROM t1
;
34 ---------------------------------------------------------
36 ---------------------------------------------------------
39 echo SELECT COUNT
(f3
) FROM t1
;
40 ---------------------------------------------------------
42 ---------------------------------------------------------
45 echo SELECT COUNT
(f4
) FROM t1
;
46 ---------------------------------------------------------
48 ---------------------------------------------------------
51 echo SELECT COUNT
(f5
) FROM t1
;
52 ---------------------------------------------------------
54 ---------------------------------------------------------
57 echo SELECT COUNT
(f6
) FROM t1
;
58 ---------------------------------------------------------
60 ---------------------------------------------------------
63 echo SELECT COUNT
(f7
) FROM t1
;
64 ---------------------------------------------------------
66 ---------------------------------------------------------
69 echo SELECT COUNT
(f8
) FROM t1
;
70 ---------------------------------------------------------
72 ---------------------------------------------------------
75 echo SELECT COUNT
(f9
) FROM t1
;
76 ---------------------------------------------------------
78 ---------------------------------------------------------
81 echo SELECT
* FROM t1
;
82 ---------------------------------------------------------
83 t1.f1 t1.f2 t1.f3 t1.f4 t1.f5 t1.f6 t1.f7 t1.f8 t1.f9
84 ---------------------------------------------------------
85 1 111 11111111 1111.111084 1111111.111111 AAAA
2001/1/1 1:1:1.0 2001/1/1 1:1:1.0
86 2 222 22222222 2222.222168 2222222.222222 BBBB
2002/2/2 2:2:2.0 2002/2/2 2:2:2.0
87 4 444 44444444 4444.444336 4444444.444444 CCCC
2004/4/4 4:4:4.0 2004/4/4 4:4:4.0
88 3 333 33333333 3333.333252 3333333.333333 CCCC
2003/3/3 3:3:3.0 2003/3/3 3:3:3.0
90 echo SELECT SUM
(f1
) FROM t1
;
91 ---------------------------------------------------------
93 ---------------------------------------------------------
96 echo SELECT SUM
(f2
) FROM t1
;
97 ---------------------------------------------------------
99 ---------------------------------------------------------
102 echo SELECT SUM
(f3
) FROM t1
;
103 ---------------------------------------------------------
105 ---------------------------------------------------------
108 echo SELECT SUM
(f4
) FROM t1
;
109 ---------------------------------------------------------
111 ---------------------------------------------------------
114 echo SELECT SUM
(f5
) FROM t1
;
115 ---------------------------------------------------------
117 ---------------------------------------------------------
120 echo SELECT
* FROM t1
;
121 ---------------------------------------------------------
122 t1.f1 t1.f2 t1.f3 t1.f4 t1.f5 t1.f6 t1.f7 t1.f8 t1.f9
123 ---------------------------------------------------------
124 1 111 11111111 1111.111084 1111111.111111 AAAA
2001/1/1 1:1:1.0 2001/1/1 1:1:1.0
125 2 222 22222222 2222.222168 2222222.222222 BBBB
2002/2/2 2:2:2.0 2002/2/2 2:2:2.0
126 4 444 44444444 4444.444336 4444444.444444 CCCC
2004/4/4 4:4:4.0 2004/4/4 4:4:4.0
127 3 333 33333333 3333.333252 3333333.333333 CCCC
2003/3/3 3:3:3.0 2003/3/3 3:3:3.0
129 echo SELECT AVG
(f1
) FROM t1
;
130 ---------------------------------------------------------
132 ---------------------------------------------------------
135 echo SELECT AVG
(f2
) FROM t1
;
136 ---------------------------------------------------------
138 ---------------------------------------------------------
141 echo SELECT AVG
(f3
) FROM t1
;
142 ---------------------------------------------------------
144 ---------------------------------------------------------
147 echo SELECT AVG
(f4
) FROM t1
;
148 ---------------------------------------------------------
150 ---------------------------------------------------------
153 echo SELECT AVG
(f5
) FROM t1
;
154 ---------------------------------------------------------
156 ---------------------------------------------------------
159 echo SELECT
* FROM t1
;
160 ---------------------------------------------------------
161 t1.f1 t1.f2 t1.f3 t1.f4 t1.f5 t1.f6 t1.f7 t1.f8 t1.f9
162 ---------------------------------------------------------
163 1 111 11111111 1111.111084 1111111.111111 AAAA
2001/1/1 1:1:1.0 2001/1/1 1:1:1.0
164 2 222 22222222 2222.222168 2222222.222222 BBBB
2002/2/2 2:2:2.0 2002/2/2 2:2:2.0
165 4 444 44444444 4444.444336 4444444.444444 CCCC
2004/4/4 4:4:4.0 2004/4/4 4:4:4.0
166 3 333 33333333 3333.333252 3333333.333333 CCCC
2003/3/3 3:3:3.0 2003/3/3 3:3:3.0
168 echo SELECT MIN
(f1
) FROM t1
;
169 ---------------------------------------------------------
171 ---------------------------------------------------------
174 echo SELECT MIN
(f2
) FROM t1
;
175 ---------------------------------------------------------
177 ---------------------------------------------------------
180 echo SELECT MIN
(f3
) FROM t1
;
181 ---------------------------------------------------------
183 ---------------------------------------------------------
186 echo SELECT MIN
(f4
) FROM t1
;
187 ---------------------------------------------------------
189 ---------------------------------------------------------
192 echo SELECT MIN
(f5
) FROM t1
;
193 ---------------------------------------------------------
195 ---------------------------------------------------------
198 echo SELECT MIN
(f7
) FROM t1
;
199 ---------------------------------------------------------
201 ---------------------------------------------------------
204 echo SELECT MIN
(f8
) FROM t1
;
205 ---------------------------------------------------------
207 ---------------------------------------------------------
210 echo SELECT MIN
(f9
) FROM t1
;
211 ---------------------------------------------------------
213 ---------------------------------------------------------
216 echo SELECT
* FROM t1
;
217 ---------------------------------------------------------
218 t1.f1 t1.f2 t1.f3 t1.f4 t1.f5 t1.f6 t1.f7 t1.f8 t1.f9
219 ---------------------------------------------------------
220 1 111 11111111 1111.111084 1111111.111111 AAAA
2001/1/1 1:1:1.0 2001/1/1 1:1:1.0
221 2 222 22222222 2222.222168 2222222.222222 BBBB
2002/2/2 2:2:2.0 2002/2/2 2:2:2.0
222 4 444 44444444 4444.444336 4444444.444444 CCCC
2004/4/4 4:4:4.0 2004/4/4 4:4:4.0
223 3 333 33333333 3333.333252 3333333.333333 CCCC
2003/3/3 3:3:3.0 2003/3/3 3:3:3.0
225 echo SELECT MAX
(f1
) FROM t1
;
226 ---------------------------------------------------------
228 ---------------------------------------------------------
231 echo SELECT MAX
(f2
) FROM t1
;
232 ---------------------------------------------------------
234 ---------------------------------------------------------
237 echo SELECT MAX
(f3
) FROM t1
;
238 ---------------------------------------------------------
240 ---------------------------------------------------------
243 echo SELECT MAX
(f4
) FROM t1
;
244 ---------------------------------------------------------
246 ---------------------------------------------------------
249 echo SELECT MAX
(f5
) FROM t1
;
250 ---------------------------------------------------------
252 ---------------------------------------------------------
255 echo SELECT MAX
(f7
) FROM t1
;
256 ---------------------------------------------------------
258 ---------------------------------------------------------
261 echo SELECT MAX
(f8
) FROM t1
;
262 ---------------------------------------------------------
264 ---------------------------------------------------------
267 echo SELECT MAX
(f9
) FROM t1
;
268 ---------------------------------------------------------
270 ---------------------------------------------------------
273 echo SELECT COUNT
(*),COUNT
(f5
),SUM
(F1
),AVG
(f3
),MIN
(f5
),MAX
(f8
) FROM t1
;
274 ---------------------------------------------------------
275 COUNT
(*) COUNT
(f5
) SUM
(f1
) AVG
(f3
) MIN
(f5
) MAX
(f8
)
276 ---------------------------------------------------------
277 4 4 10 27777777.500000 1111111.111111 4:4:4.0