adding test scripts
[csql.git] / test / tools / csql / datatype2.sql
blob26909daa875726fa238d445e28c159c77cf05bdf
1 echo char datatype testing;
3 create table t1 (f1 char(20), f2 char(20), primary key (f1));
4 insert into t1 values ('10', 'A');
5 insert into t1 values ('11', 'B');
6 insert into t1 values ('12', 'C');
7 insert into t1 values ('13', 'D');
8 insert into t1 values ('14', '14');
9 insert into t1 values ('50', 'E');
10 insert into t1 values ('This is really a very big string. should get cut when it is stored', 'E');
11 insert into t1 values ('UPPERCASE', 'UPPER');
12 insert into t1 values ('uppercase', 'LOWER');
13 insert into t1 values ('upperletter', 'LOWER');
14 insert into t1 values ('uppercaseletter', 'LOWER');
15 echo select * from t1;
16 select * from t1;
17 echo select * from t1 where f1 = '10';
18 select * from t1 where f1 = '10';
19 echo select * from t1 where f1 != '12' AND f2 <= '13';
20 select * from t1 where f1 != '12' AND f2 <= '13';
21 echo select * from t1 where f1 = '12' AND f2 >= '22';
22 select * from t1 where f1 = '12' AND f2 >= '22';
23 echo select * from t1 where f1 = '12' OR  f1 > '13';
24 select * from t1 where f1 = '12' OR  f1 > '13';
25 echo select * from t1 where f1 = '12' OR f2 = '13';
26 select * from t1 where f1 = '12' OR f2 < '13';
27 echo select * from t1 where f1 = '12' OR f2 < '22';
28 select * from t1 where f1 = '12' OR f2 <> '22';
29 echo select * from t1 where NOT f1 = '12';
30 select * from t1 where NOT f1 = '12';
31 echo select * from t1 where f1 != '12';
32 select * from t1 where f1 != '12';
33 echo select * from t1 where NOT f1 != '12';
34 select * from t1 where NOT f1 != '12';
35 echo select * from t1 where f1 = f2;
36 select * from t1 where f1 = f2;
38 echo select * from t1 where f2 between 'A' AND 'C';
39 select * from t1 where f2 between 'A' AND 'C';
41 echo update t1 set f2 = '2' where f1 != f2;
42 update t1 set f2 = '2' where f1 != f2;
43 select * from t1;
45 echo update t1 set f2 = '3' where f1 = '50';
46 update t1 set f2 = '3' where f1 = '50';
47 select * from t1;
49 delete from t1 where f1 = '50';
50 select * from t1;
51 drop table t1;