*** empty log message ***
[csql.git] / test / tools / csql / csql3.sql
blob28b5e4cda340deb5537375bacde8143d47a0154b
1 echo Same as csql2 but with primary key;
3 create table t1 (f1 int, f2 int, primary key (f1));
4 insert into t1 values (10, 20);
5 insert into t1 values (11, 21);
6 insert into t1 values (12, 22);
7 insert into t1 values (13, 23);
8 insert into t1 values (14, 24);
9 insert into t1 values (50, 50);
10 echo select * from t1;
11 select * from t1;
12 echo select * from t1 where f1 = 100;
13 select * from t1 where f1 = 100;
14 echo select * from t1 where f1 = 10;
15 select * from t1 where f1 = 10;
16 echo select f1 from t1 where f1 = 11;
17 select f1 from t1 where f1 = 11;
18 echo select f2 from t1 where f1 = 11;
19 select f2 from t1 where f1 = 11;
20 echo select f1, f2 from t1 where f1 = 12;
21 select f1, f2 from t1 where f1 = 12;
22 echo select * from t1 where f1 != 12 AND f2 <= 13;
23 select * from t1 where f1 != 12 AND f2 <= 13;
24 echo select * from t1 where f1 = 12 AND f2 >= 22;
25 select * from t1 where f1 = 12 AND f2 >= 22;
26 echo select * from t1 where f1 = 12 OR  f1 > 13;
27 select * from t1 where f1 = 12 OR  f1 > 13;
28 echo select * from t1 where f1 = 12 OR f2 < 13;
29 select * from t1 where f1 = 12 OR f2 < 13;
30 echo select * from t1 where f1 = 12 OR f2 <> 22;
31 select * from t1 where f1 = 12 OR f2 <> 22;
32 echo select * from t1 where NOT f1 = 12;
33 select * from t1 where NOT f1 = 12;
34 echo select * from t1 where f1 != 12;
35 select * from t1 where f1 != 12;
36 echo select * from t1 where NOT f1 != 12;
37 select * from t1 where NOT f1 != 12;
38 echo select * from t1 where NOT (f1 = 12 AND f2 =22);
39 select * from t1 where NOT (f1 = 12 AND f2 =22);
40 echo select * from t1 where NOT (f1 = 12 OR f2 = 23);
41 select * from t1 where NOT (f1 = 12 OR f2 = 23);
42 echo select * from t1 where f1 = 12 OR f2 = 23 OR f2 = 22;
43 select * from t1 where f1 = 12 OR f2 = 23 OR f2 = 22;
44 echo select * from t1 where  f1+12 = 20;
45 select * from t1 where  f1+12 = 20;
46 echo select * from t1 where f1 = 12 + f2;
47 select * from t1 where f1 = 12 + f2;
48 echo select * from t1 where f1 =  f2;
49 select * from t1 where f1 = f2;
50 echo select * from t1 where f1=12 and f1<=13 or f1>=11;
51 select * from t1 where f1=12 and f1<=13 or f1>=11;
52 drop table t1;