core reorg
[csql.git] / test / sql / Aggregate / testnw025.ksh
blobaf3ef0e1148c213bea816d9c5ac7aa71a5d790a7
1 #!/bin/ksh
2 # Testing Join on 5 sales tables.
3 # Create 5 tables like client_master,product_master,salesman_master,sales_order,sales_order_details.
4 # populate the above tables with required values.
5 # Test join, aggregate and having on them by executing the following query:
6 # List average qty sold for each client that has average of qty sold >3average of qty sold >3. Same apply for count,min,max and sum.
8 QUITFILE=${PWD}/sql/Aggregate/quit.sql
9 REL_PATH=.
10 if [ -s "$QUITFILE" ]
11 then
12 REL_PATH=`pwd`/sql/Aggregate
15 $CSQL_INSTALL_ROOT/bin/csql -o 4 -s ${REL_PATH}/sales_tables.sql
16 if [ $? -ne 0 ]
17 then
18 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/sales_table_drop.sql
19 exit 1;
22 $CSQL_INSTALL_ROOT/bin/csql -o 4 -s ${REL_PATH}/sales_join_aggregate.sql
23 if [ $? -ne 0 ]
24 then
25 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/sales_table_drop.sql
26 exit 2;
29 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/sales_table_drop.sql
30 if [ $? -ne 0 ]
31 then
32 exit 3;
35 exit 0;