Begin;
Initialize;
InitializeSession "";
Command "create database TESTDB";
TerminateSession;
InitializeSession "TESTDB";
Command  "create table T1(C1 int, C2 varchar(2), C3 nvarchar(4), C4 nvarchar(448))";
Command  "create index I1_1 on T1(C1)";
Command  "create index I1_2 on T1(C2)";
Command  "create index I1_3 on T1(C3)";
Command  "create index I1_4 on T1(C4)";
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [111,  "1",  "ほげ", textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [222,  "2",  "ホゲ", textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [222,  "3",  "ホゲ", textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [222,  "4",  "ホゲ", textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [null,  1,   "ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [333,  null, "ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [333,  "3",  null,   textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [333,  "4",  "ぴよ", null                                 ];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [null, null, "ピヨ", textsjisfile "..\\..\\doc\\in_lab.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [444,  "2",   null,  null                                 ];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [444,  null,  null,  textsjisfile "..\\..\\doc\\in_lab.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [null, "4",  "ピヨ", null                                 ];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [111,  null,  null,  null                                 ];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [null, "1",   null,  null                                 ];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [null, null, "ほげ", null                                 ];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [null, null,  null,  textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [null, null,  null,  null                                 ];
Command  "create table T2(C1 int)";
Command  "create index I2_1 on T2(C1)";
Command  "insert into T2 (C1) values (?)" [111 ];
Command  "insert into T2 (C1) values (?)" [null];
Command  "insert into T2 (C1) values (?)" [333 ];
Command  "insert into T2 (C1) values (?)" [444 ];
Command  "insert into T2 (C1) values (?)" [666 ];
Command  "select * from T1 natural inner join T2 where C4 like (?)" ["株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C4 like (?)" ["株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C4 like (?)" ["株式会社リコー%"];
Command  "drop table T2";

Command  "create table T2(C3 nvarchar(4))";
Command  "create index I2_1 on T2(C3)";
Command  "insert into T2 (C3) values (?)" ["ほげ"];
Command  "insert into T2 (C3) values (?)" ["ホホ"];
Command  "insert into T2 (C3) values (?)" ["ぴよ"];
Command  "insert into T2 (C3) values (?)" ["ピヨ"];
Command  "insert into T2 (C3) values (?)" ["ぷう"];
Command  "select * from T1 natural inner join T2 where C3 like (?)" ["ほ%"];
Command  "select * from (select C3 from T2 where C3 like (?)) as T3 natural inner join T1" ["ほ%"];
Command  "select * from T1 natural left outer join T2 where C3 like (?)"   ["ほ%"];
Command  "select * from (select C3 from T2 where C3 like (?)) as T3 natural left outer join T1" ["ほ%"];
Command  "select * from T1 natural right outer join T2 where C3 like (?)"   ["ほ%"];
Command  "select * from (select C3 from T2 where C3 like (?)) as T3 natural right outer join T1" ["ほ%"];
Command  "drop table T2";

Command  "create table T2(C2 varchar(2))";
Command  "create index I2_1 on T2(C2)";
Command  "insert into T2 (C2) values (?)" ["1" ];
Command  "insert into T2 (C2) values (?)" [null];
Command  "insert into T2 (C2) values (?)" ["3" ];
Command  "insert into T2 (C2) values (?)" ["4" ];
Command  "insert into T2 (C2) values (?)" ["6" ];
Command  "select * from T1 natural inner join T2 where C4 like (?)" ["株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C4 like (?)" ["株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C4 like (?)" ["株式会社リコー%"];
Command  "drop table T2";

Command  "create table T2(C3 nvarchar(4))";
Command  "create index I2_1 on T2(C3)";
Command  "insert into T2 (C3) values (?)" ["ほげ"];
Command  "insert into T2 (C3) values (?)" [ null ];
Command  "insert into T2 (C3) values (?)" ["ぴよ"];
Command  "insert into T2 (C3) values (?)" ["ピヨ"];
Command  "insert into T2 (C3) values (?)" ["ぷう"];
Command  "select * from T1 natural inner join T2 where C4 like (?)" ["株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C4 like (?)" ["株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C4 like (?)" ["株式会社リコー%"];
Command  "drop table T2";

Command  "create table T2(C4 nvarchar(448))";
Command  "create index I2_1 on T2(C4)";
Command  "insert into T2 (C4) values (?)" [textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T2 (C4) values (?)" [null                                 ];
Command  "insert into T2 (C4) values (?)" [textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C4) values (?)" [textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C4) values (?)" [textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "select * from T1 natural inner join T2 where C4 like (?)" ["株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C4 like (?)" ["株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C4 like (?)" ["株式会社リコー%"];
Command  "drop table T2";

Command  "create table T2(C1 int, C2 varchar(2))";
Command  "create index I2_1 on T2(C1, C2)";
Command  "insert into T2 (C1, C2) values (?, ?)" [111,  "1" ];
Command  "insert into T2 (C1, C2) values (?, ?)" [null, "2" ];
Command  "insert into T2 (C1, C2) values (?, ?)" [333,  "3" ];
Command  "insert into T2 (C1, C2) values (?, ?)" [444,  null];
Command  "insert into T2 (C1, C2) values (?, ?)" [666,  "6" ];
Command  "insert into T2 (C1, C2) values (?, ?)" [null, null];
Command  "select * from T1 natural inner join T2 where C1 >= (?) and C4 like (?)" [222, "株式会社リコー%"];
Command  "select * from T1 natural inner join T2 where C2 >= (?) and C4 like (?)" ["2", "株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C1 >= (?) and C4 like (?)" [222, "株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C2 >= (?) and C4 like (?)" ["2", "株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C1 >= (?) and C4 like (?)" [222, "株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C2 >= (?) and C4 like (?)" ["2", "株式会社リコー%"];
Command  "drop table T2";

Command  "create table T2(C1 int, C3 nvarchar(4))";
Command  "create index I2_1 on T2(C1, C3)";
Command  "insert into T2 (C1, C3) values (?, ?)" [111,  "ほげ"];
Command  "insert into T2 (C1, C3) values (?, ?)" [null, "ホゲ"];
Command  "insert into T2 (C1, C3) values (?, ?)" [333,  "ぴよ"];
Command  "insert into T2 (C1, C3) values (?, ?)" [444,   null ];
Command  "insert into T2 (C1, C3) values (?, ?)" [666,  "ぷう"];
Command  "insert into T2 (C1, C3) values (?, ?)" [null,  null ];
Command  "select * from T1 natural inner join T2 where C1 >= (?) and C4 like (?)" [222, "株式会社リコー%"];
Command  "select * from T1 natural inner join T2 where C3 >= (?) and C2 like (?)" ["ほげ", "2"];
Command  "select * from T1 natural inner join T2 where C3 >= (?) and C4 like (?)" ["ほげ", "株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C1 >= (?) and C4 like (?)" [222, "株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C3 >= (?) and C2 like (?)" ["ほげ", "2"];
Command  "select * from T1 natural left outer join T2 where C3 >= (?) and C4 like (?)" ["ほげ", "株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C1 >= (?) and C4 like (?)" [222, "株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C3 >= (?) and C2 like (?)" ["ほげ", "2"];
Command  "select * from T1 natural right outer join T2 where C3 >= (?) and C4 like (?)" ["ほげ", "株式会社リコー%"];
Command  "drop table T2";

Command  "create table T2(C1 int, C4 nvarchar(448))";
Command  "create index I2_1 on T2(C1, C4)";
Command  "insert into T2 (C1, C4) values (?, ?)" [111,  textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T2 (C1, C4) values (?, ?)" [null, textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C1, C4) values (?, ?)" [333,  textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C1, C4) values (?, ?)" [444,  null                                 ];
Command  "insert into T2 (C1, C4) values (?, ?)" [666,  textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C1, C4) values (?, ?)" [null, null                                 ];
Command  "select * from T1 natural inner join T2 where C1 >= (?) and C4 like (?)" [222, "株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C1 >= (?) and C4 like (?)" [222, "株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C1 >= (?) and C4 like (?)" [222, "株式会社リコー%"];
Command  "select * from T1 natural inner join T2 where C4 like (?) and C2 >= (?)" ["株式会社リコー%", "2"];
Command  "select * from T1 natural inner join T2 where C4 like (?) and C3 >= (?)" ["株式会社リコー%", "ほげ"];
Command  "select * from T1 natural left outer join T2 where C4 like (?) and C2 >= (?)" ["株式会社リコー%", "2"];
Command  "select * from T1 natural left outer join T2 where C4 like (?) and C3 >= (?)" ["株式会社リコー%", "ほげ"];
Command  "select * from T1 natural right outer join T2 where C4 like (?) and C2 >= (?)" ["株式会社リコー%", "2"];
Command  "select * from T1 natural right outer join T2 where C4 like (?) and C3 >= (?)" ["株式会社リコー%", "ほげ"];
Command  "drop table T2";

Command  "create table T2(C2 varchar(2), C3 nvarchar(4))";
Command  "create index I2_1 on T2(C2, C3)";
Command  "insert into T2 (C2, C3) values (?, ?)" ["1",  "ほげ"];
Command  "insert into T2 (C2, C3) values (?, ?)" [null, "ホゲ"];
Command  "insert into T2 (C2, C3) values (?, ?)" ["3",  "ぴよ"];
Command  "insert into T2 (C2, C3) values (?, ?)" ["4",   null ];
Command  "insert into T2 (C2, C3) values (?, ?)" ["6",  "ぷう"];
Command  "insert into T2 (C2, C3) values (?, ?)" [null,  null ];
Command  "select * from T1 natural inner join T2 where C2 >= (?) and C4 like (?)" ["2", "株式会社リコー%"];
Command  "select * from T1 natural inner join T2 where C3 >= (?) and C4 like (?)" ["ほげ", "株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C2 >= (?) and C4 like (?)" ["2", "株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C3 >= (?) and C4 like (?)" ["ほげ", "株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C2 >= (?) and C4 like (?)" ["2", "株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C3 >= (?) and C4 like (?)" ["ほげ", "株式会社リコー%"];
Command  "drop table T2";

Command  "create table T2(C2 varchar(2), C4 nvarchar(448))";
Command  "create index I2_1 on T2(C2, C4)";
Command  "insert into T2 (C2, C4) values (?, ?)" ["1",  textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T2 (C2, C4) values (?, ?)" [null, textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C2, C4) values (?, ?)" ["3",  textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C2, C4) values (?, ?)" ["4",  null                                 ];
Command  "insert into T2 (C2, C4) values (?, ?)" ["6",  textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C2, C4) values (?, ?)" [null, null                                 ];
Command  "select * from T1 natural inner join T2 where C2 >= (?) and C4 like (?)" ["2", "株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C2 >= (?) and C4 like (?)" ["2", "株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C2 >= (?) and C4 like (?)" ["2", "株式会社リコー%"];
Command  "select * from T1 natural inner join T2 where C4 like (?) and C1 >= (?)" ["株式会社リコー%", 222];
Command  "select * from T1 natural inner join T2 where C4 like (?) and C3 >= (?)" ["株式会社リコー%", "ほげ"];
Command  "select * from T1 natural left outer join T2 where C4 like (?) and C1 >= (?)" ["株式会社リコー%", 222];
Command  "select * from T1 natural left outer join T2 where C4 like (?) and C3 >= (?)" ["株式会社リコー%", "ほげ"];
Command  "select * from T1 natural right outer join T2 where C4 like (?) and C1 >= (?)" ["株式会社リコー%", 222];
Command  "select * from T1 natural right outer join T2 where C4 like (?) and C3 >= (?)" ["株式会社リコー%", "ほげ"];
Command  "drop table T2";

Command  "create table T2(C3 nvarchar(4), C4 nvarchar(448))";
Command  "create index I2_1 on T2(C3, C4)";
Command  "insert into T2 (C3, C4) values (?, ?)" ["ほげ", textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T2 (C3, C4) values (?, ?)" [ null,  textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C3, C4) values (?, ?)" ["ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C3, C4) values (?, ?)" ["ピヨ", null                                 ];
Command  "insert into T2 (C3, C4) values (?, ?)" ["ぷう", textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C3, C4) values (?, ?)" [ null,  null                                 ];
Command  "select * from T1 natural inner join T2 where C3 >= (?) and C4 like (?)" ["ほげ", "株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C3 >= (?) and C4 like (?)" ["ほげ", "株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C3 >= (?) and C4 like (?)" ["ほげ", "株式会社リコー%"];
Command  "select * from T1 natural inner join T2 where C4 like (?) and C1 >= (?)" ["株式会社リコー%", 222];
Command  "select * from T1 natural inner join T2 where C4 like (?) and C2 >= (?)" ["株式会社リコー%", "2"];
Command  "select * from T1 natural left outer join T2 where C4 like (?) and C1 >= (?)" ["株式会社リコー%", 222];
Command  "select * from T1 natural left outer join T2 where C4 like (?) and C2 >= (?)" ["株式会社リコー%", "2"];
Command  "select * from T1 natural right outer join T2 where C4 like (?) and C1 >= (?)" ["株式会社リコー%", 222];
Command  "select * from T1 natural right outer join T2 where C4 like (?) and C2 >= (?)" ["株式会社リコー%", "2"];
Command  "drop table T2";

Command  "create table T2(C1 int, C2 varchar(2))";
Command  "create index I2_1 on T2(C1, C2)";
Command  "insert into T2 (C1, C2) values (?, ?)" [111,  "1" ];
Command  "insert into T2 (C1, C2) values (?, ?)" [null, "2" ];
Command  "insert into T2 (C1, C2) values (?, ?)" [333,  "3" ];
Command  "insert into T2 (C1, C2) values (?, ?)" [444,  null];
Command  "insert into T2 (C1, C2) values (?, ?)" [666,  "6" ];
Command  "insert into T2 (C1, C2) values (?, ?)" [null, null];
Command  "select * from T1 natural inner join T2 where C3 >= (?) and C4 like (?)" ["ほげ", "株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C3 >= (?) and C4 like (?)" ["ほげ", "株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C3 >= (?) and C4 like (?)" ["ほげ", "株式会社リコー%"];
Command  "drop table T2";

Command  "create table T2(C1 int, C3 nvarchar(4))";
Command  "create index I2_1 on T2(C1, C3)";
Command  "insert into T2 (C1, C3) values (?, ?)" [111,  "ほげ"];
Command  "insert into T2 (C1, C3) values (?, ?)" [null, "ホゲ"];
Command  "insert into T2 (C1, C3) values (?, ?)" [333,  "ぴよ"];
Command  "insert into T2 (C1, C3) values (?, ?)" [444,   null ];
Command  "insert into T2 (C1, C3) values (?, ?)" [666,  "ぷう"];
Command  "insert into T2 (C1, C3) values (?, ?)" [null,  null ];
Command  "select * from T1 natural inner join T2 where C2 >= (?) and C4 like (?)" ["2", "株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C2 >= (?) and C4 like (?)" ["2", "株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C2 >= (?) and C4 like (?)" ["2", "株式会社リコー%"];
Command  "drop table T2";

Command  "create table T2(C1 int, C4 nvarchar(448))";
Command  "create index I2_1 on T2(C1, C4)";
Command  "insert into T2 (C1, C4) values (?, ?)" [111,  textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T2 (C1, C4) values (?, ?)" [null, textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C1, C4) values (?, ?)" [333,  textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C1, C4) values (?, ?)" [444,  null                                 ];
Command  "insert into T2 (C1, C4) values (?, ?)" [666,  textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C1, C4) values (?, ?)" [null, null                                 ];
Command  "drop table T2";

Command  "create table T2(C2 varchar(2), C3 nvarchar(4))";
Command  "create index I2_1 on T2(C2, C3)";
Command  "insert into T2 (C2, C3) values (?, ?)" ["1",  "ほげ"];
Command  "insert into T2 (C2, C3) values (?, ?)" [null, "ホゲ"];
Command  "insert into T2 (C2, C3) values (?, ?)" ["3",  "ぴよ"];
Command  "insert into T2 (C2, C3) values (?, ?)" ["4",   null ];
Command  "insert into T2 (C2, C3) values (?, ?)" ["6",  "ぷう"];
Command  "insert into T2 (C2, C3) values (?, ?)" [null,  null ];
Command  "select * from T1 natural inner join T2 where C1 >= (?) and C4 like (?)" [222, "株式会社リコー%"];
Command  "select * from T1 natural left outer join T2 where C1 >= (?) and C4 like (?)" [222, "株式会社リコー%"];
Command  "select * from T1 natural right outer join T2 where C1 >= (?) and C4 like (?)" [222, "株式会社リコー%"];
Command  "drop table T2";

Command  "create table T2(C2 varchar(2), C4 nvarchar(448))";
Command  "create index I2_1 on T2(C2, C4)";
Command  "insert into T2 (C2, C4) values (?, ?)" ["1",  textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T2 (C2, C4) values (?, ?)" [null, textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C2, C4) values (?, ?)" ["3",  textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C2, C4) values (?, ?)" ["4",  null                                 ];
Command  "insert into T2 (C2, C4) values (?, ?)" ["6",  textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C2, C4) values (?, ?)" [null, null                                 ];
Command  "drop table T2";

Command  "create table T2(C3 nvarchar(4), C4 nvarchar(448))";
Command  "create index I2_1 on T2(C3, C4)";
Command  "insert into T2 (C3, C4) values (?, ?)" ["ほげ", textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T2 (C3, C4) values (?, ?)" [ null,  textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C3, C4) values (?, ?)" ["ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C3, C4) values (?, ?)" ["ピヨ", null                                 ];
Command  "insert into T2 (C3, C4) values (?, ?)" ["ぷう", textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C3, C4) values (?, ?)" [ null,  null                                 ];
Command  "drop table T2";

Command  "drop table T1";
TerminateSession;
InitializeSession "";
Command  "drop database TESTDB";
TerminateSession;
Terminate;
End;