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