adding test scripts
[csql.git] / test / sql / Aggregate / writer.sql
blob1a827ac60911d289bdb0e527eab3eec3b171bb9d
1 echo CREATE TABLE writer (poet char(50) , anthology char(40) , copies_in_stock tinyint(4)) ;
2 CREATE TABLE writer (poet char(50) , anthology char(40) , copies_in_stock tinyint(4)) ;
3 echo INSERT INTO writer VALUES ('Mongane Wally Serote','Tstetlo',3);
4 INSERT INTO writer VALUES ('Mongane Wally Serote','Tstetlo',3);
5 echo INSERT INTO writer VALUES ('Douglas Livingstone', 'The Skull in the Mud',21);
6 INSERT INTO writer VALUES ('Douglas Livingstone', 'The Skull in the Mud',21);
7 echo INSERT INTO writer VALUES ('Mongane Wally Serote', 'No Baby Must Weep',8);
8 INSERT INTO writer VALUES ('Mongane Wally Serote', 'No Baby Must Weep',8);
9 echo INSERT INTO writer VALUES ('Douglas Livingstone', 'A Littoral Zone',2);
10 INSERT INTO writer VALUES ('Douglas Livingstone', 'A Littoral Zone',2);
11 echo INSERT INTO writer VALUES ('Mongane Wally Serote', 'A Tough Tale',2);
12 INSERT INTO writer VALUES ('Mongane Wally Serote', 'A Tough Tale',2);
13 echo SELECT * FROM writer;
14 SELECT * FROM writer;
15 echo SELECT poet, MAX(copies_in_stock) , MIN(copies_in_stock) , AVG(copies_in_stock) , SUM(copies_in_stock)  FROM writer GROUP BY poet;
16 SELECT poet, MAX(copies_in_stock) , MIN(copies_in_stock) , AVG(copies_in_stock) , SUM(copies_in_stock)  FROM writer GROUP BY poet;