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  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [111,  "1",  "ほげ", textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [111,  "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\\hello.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [222,  "1",  "ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [333,  "1",  "ホゲ", textsjisfile "..\\..\\doc\\in_lab.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [444,  "3",  "らら",  textsjisfile "..\\..\\doc\\in_lab.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [444,  "4",  "ぴよ", "今日は雨のち曇り"                    ];
Command  "create table T2(C5 int, C6 varchar(2), C7 nvarchar(4), C8 nvarchar(448))";
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [111,  "1",  "ほげ", textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [222,  "2",  "ほげ", textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [333,  "2",  "ホゲ", textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [444,  "2",  "ホゲ", textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [444,  "3",   "ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [222,  "3", "ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [333,  "3",   "ぶぶ",  textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [444,  "3",  "ぷう", "今日は水曜日"                         ];
Command  "select * from T1 inner join T2 on C1 = C5 where C7 like (?)" ["ほ%"];
Command  "select * from (select C7 from T2 where C7 like (?)) as T3 inner join T1 on C3 = C7" ["ほ%"];
Command  "select * from T1 left outer join T2 on C1 = C5 where C7 like (?)"   ["ほ%"];
Command  "select * from (select C7 from T2 where C7 like (?)) as T3 left outer join T1 on C3 = C7" ["ほ%"];
Command  "select * from T1 right outer join T2 on C1 = C5 where C7 like (?)"   ["ほ%"];
Command  "select * from (select C7 from T2 where C7 like (?)) as T3 right outer join T1 on C3 = C7" ["ほ%"];
Command  "select * from T1 inner join T2 on C1 = C5 and C2 = C6 where C7 like (?)" ["ほ%"];
Command  "select * from (select C5, C7 from T2 where C7 like (?)) as T3 inner join T1 on  C1 = C5 and C3 = C7" ["ほ%"];
Command  "select * from T1 left outer join T2 on C1 = C5 and C2 = C6 where C7 like (?)" ["ほ%"];
Command  "select * from (select C5, C7 from T2 where C7 like (?)) as T3 left outer join T1 on  C1 = C5 and C3 = C7" ["ほ%"];
Command  "select * from T1 right outer join T2 on C1 = C5 and C2 = C6 where C7 like (?)" ["ほ%"];
Command  "select * from (select C5, C7 from T2 where C7 like (?)) as T3 right outer join T1 on  C1 = C5 and C3 = C7" ["ほ%"];
Command  "drop table T1";

Command  "create table T1(C1 int, C2 varchar(2), C3 nvarchar(4), C4 nvarchar(448))";
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [111,  "1",  "ほげ", textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [111,  "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\\hello.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,  "1",  "ホゲ", textsjisfile "..\\..\\doc\\in_lab.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [444,  "3",  "らら",  textsjisfile "..\\..\\doc\\in_lab.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [444,  "4",  "ぴよ", "今日は雨のち曇り"                    ];
Command  "select * from T1 inner join T2 on C1 = C5 where C7 like (?)" ["ほ%"];
Command  "select * from (select C7 from T2 where C7 like (?)) as T3 inner join T1 on C3 = C7" ["ほ%"];
Command  "select * from T1 left outer join T2 on C1 = C5 where C7 like (?)"   ["ほ%"];
Command  "select * from (select C7 from T2 where C7 like (?)) as T3 left outer join T1 on C3 = C7" ["ほ%"];
Command  "select * from T1 right outer join T2 on C1 = C5 where C7 like (?)"   ["ほ%"];
Command  "select * from (select C7 from T2 where C7 like (?)) as T3 right outer join T1 on C3 = C7" ["ほ%"];
Command  "select * from T1 inner join T2 on C1 = C5 and C2 = C6 where C7 like (?)" ["ほ%"];
Command  "select * from (select C5, C7 from T2 where C7 like (?)) as T3 inner join T1 on  C1 = C5 and C3 = C7" ["ほ%"];
Command  "select * from T1 left outer join T2 on C1 = C5 and C2 = C6 where C7 like (?)" ["ほ%"];
Command  "select * from (select C5, C7 from T2 where C7 like (?)) as T3 left outer join T1 on  C1 = C5 and C3 = C7" ["ほ%"];
Command  "select * from T1 right outer join T2 on C1 = C5 and C2 = C6 where C7 like (?)" ["ほ%"];
Command  "select * from (select C5, C7 from T2 where C7 like (?)) as T3 right outer join T1 on  C1 = C5 and C3 = C7" ["ほ%"];
Command "drop table T1";
Command "drop table T2";

Command  "create table T1(C1 int, C2 varchar(2), C3 nvarchar(4), C4 nvarchar(448))";
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [111,  "1",  "ほげ", textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [111,  "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\\hello.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [222,  "1",  "ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [333,  "1",  "ホゲ", textsjisfile "..\\..\\doc\\in_lab.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [444,  "3",  "らら",  textsjisfile "..\\..\\doc\\in_lab.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [444,  "4",  "ぴよ", "今日は雨のち曇り"                    ];
Command  "create table T2(C5 int, C6 varchar(2), C7 nvarchar(4), C8 nvarchar(448))";
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [111,  "1",  "ほげ", textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [222,  "2",  "ほげ", textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [333,  "2",  "ホゲ", textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [444,  "2",  "ホゲ", textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [null,  "3",   "ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [222,  "3", "ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [333,  "3",   "ぶぶ",  textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [null,  "3",  "ぷう", "今日は水曜日"                         ];
Command  "select * from T1 inner join T2 on C1 = C5 where C7 like (?)" ["ほ%"];
Command  "select * from (select C7 from T2 where C7 like (?)) as T3 inner join T1 on C3 = C7" ["ほ%"];
Command  "select * from T1 left outer join T2 on C1 = C5 where C7 like (?)"   ["ほ%"];
Command  "select * from (select C7 from T2 where C7 like (?)) as T3 left outer join T1 on C3 = C7" ["ほ%"];
Command  "select * from T1 right outer join T2 on C1 = C5 where C7 like (?)"   ["ほ%"];
Command  "select * from (select C7 from T2 where C7 like (?)) as T3 right outer join T1 on C3 = C7" ["ほ%"];
Command  "select * from T1 inner join T2 on C1 = C5 and C2 = C6 where C7 like (?)" ["ほ%"];
Command  "select * from (select C5, C7 from T2 where C7 like (?)) as T3 inner join T1 on  C1 = C5 and C3 = C7" ["ほ%"];
Command  "select * from T1 left outer join T2 on C1 = C5 and C2 = C6 where C7 like (?)" ["ほ%"];
Command  "select * from (select C5, C7 from T2 where C7 like (?)) as T3 left outer join T1 on  C1 = C5 and C3 = C7" ["ほ%"];
Command  "select * from T1 right outer join T2 on C1 = C5 and C2 = C6 where C7 like (?)" ["ほ%"];
Command  "select * from (select C5, C7 from T2 where C7 like (?)) as T3 right outer join T1 on  C1 = C5 and C3 = C7" ["ほ%"];
Command "drop table T1";
Command "drop table T2";

Command  "create table T1(C1 int, C2 varchar(2), C3 nvarchar(4), C4 nvarchar(448))";
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [111,  "1",  "ほげ", textsjisfile "..\\..\\doc\\lab.txt"   ];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [null,  "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 (?, ?, ?, ?)" [null,  "4",  "ホゲ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [222,  "1",  "ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [333,  "1",  "ホゲ", textsjisfile "..\\..\\doc\\in_lab.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [444,  "3",  "らら",  textsjisfile "..\\..\\doc\\in_lab.txt"];
Command  "insert into T1 (C1, C2, C3, C4) values (?, ?, ?, ?)" [null,  "4",  "ぴよ", "今日は雨のち曇り"                    ];
Command  "create table T2(C5 int, C6 varchar(2), C7 nvarchar(4), C8 nvarchar(448))";
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [null,  "1",  "ほげ", textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [222,  "2",  "ほげ", textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [null,  "2",  "ホゲ", textsjisfile "..\\..\\doc\\ricoh.txt"];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [444,  "2",  "ホゲ", textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [null,  "3",   "ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [222,  "3", "ぴよ", textsjisfile "..\\..\\doc\\hello.txt"];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [333,  "3",   "ぶぶ",  textsjisfile "..\\..\\doc\\in_lab.txt"   ];
Command  "insert into T2 (C5, C6, C7, C8) values (?, ?, ?, ?)" [444,  "3",  "ぷう", "今日は水曜日"                         ];
Command  "select * from T1 inner join T2 on C1 = C5 where C7 like (?)" ["ほ%"];
Command  "select * from (select C7 from T2 where C7 like (?)) as T3 inner join T1 on C3 = C7" ["ほ%"];
Command  "select * from T1 left outer join T2 on C1 = C5 where C7 like (?)"   ["ほ%"];
Command  "select * from (select C7 from T2 where C7 like (?)) as T3 inner join T1 on C3 = C7" ["ほ%"];
Command  "select * from T1 right outer join T2 on C1 = C5 where C7 like (?)"   ["ほ%"];
Command  "select * from (select C7 from T2 where C7 like (?)) as T3 right outer join T1 on C3 = C7" ["ほ%"];
Command  "select * from T1 inner join T2 on C1 = C5 and C2 = C6 where C7 like (?)" ["ほ%"];
Command  "select * from (select C5, C7 from T2 where C7 like (?)) as T3 inner join T1 on  C1 = C5 and C3 = C7" ["ほ%"];
Command  "select * from T1 left outer join T2 on C1 = C5 and C2 = C6 where C7 like (?)" ["ほ%"];
Command  "select * from (select C5, C7 from T2 where C7 like (?)) as T3 left outer join T1 on  C1 = C5 and C3 = C7" ["ほ%"];
Command  "select * from T1 right outer join T2 on C1 = C5 and C2 = C6 where C7 like (?)" ["ほ%"];
Command  "select * from (select C5, C7 from T2 where C7 like (?)) as T3 right outer join T1 on  C1 = C5 and C3 = C7" ["ほ%"];
Command  "drop table T1";
Command  "drop table T2";



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