adding test scripts
[csql.git] / test / sql / Aggregate / exp.test032.ksh
blobbf5cf724cf620e187e70f1a1aecf63313e746373
1 echo CREATE TABLE writer (poet char(50) , anthology char(40) , copies_in_stock tinyint(4)) ;
2 Statement Executed
3 echo INSERT INTO writer VALUES ('Mongane Wally Serote','Tstetlo',3);
4 Statement Executed: Rows Affected = 1
5 echo INSERT INTO writer VALUES ('Douglas Livingstone', 'The Skull in the Mud',21);
6 Statement Executed: Rows Affected = 1
7 echo INSERT INTO writer VALUES ('Mongane Wally Serote', 'No Baby Must Weep',8);
8 Statement Executed: Rows Affected = 1
9 echo INSERT INTO writer VALUES ('Douglas Livingstone', 'A Littoral Zone',2);
10 Statement Executed: Rows Affected = 1
11 echo INSERT INTO writer VALUES ('Mongane Wally Serote', 'A Tough Tale',2);
12 Statement Executed: Rows Affected = 1
13 echo SELECT * FROM writer;
14 ---------------------------------------------------------
15 writer.poet writer.anthology writer.copies_in_stock
16 ---------------------------------------------------------
17 Mongane Wally Serote Tstetlo 3
18 Douglas Livingstone The Skull in the Mud 21
19 Mongane Wally Serote No Baby Must Weep 8
20 Douglas Livingstone A Littoral Zone 2
21 Mongane Wally Serote A Tough Tale 2
23 echo SELECT poet, MAX(copies_in_stock) , MIN(copies_in_stock) , AVG(copies_in_stock) , SUM(copies_in_stock) FROM writer GROUP BY poet;
24 ---------------------------------------------------------
25 poet MAX(copies_in_stock) MIN(copies_in_stock) AVG(copies_in_stock) SUM(copies_in_stock)
26 ---------------------------------------------------------
27 Mongane Wally Serote 8 2 4.333333 13
28 Douglas Livingstone 21 2 11.500000 23
30 Statement Executed