USE tpch1; select n1.n_nationkey, n1.n_regionkey from nation n1, nation n2 where n1.n_nationkey = n2.n_regionkey order by 1, 2; n_nationkey n_regionkey 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 2 1 2 1 3 1 3 1 3 1 3 1 3 1 4 4 4 4 4 4 4 4 4 4 select o1.o_orderkey o1order, o2.o_custkey o2order, o1.o_custkey from orders o1, orders o2 where o1.o_custkey = o2.o_orderkey and o1.o_orderdate <= '1992-01-01' and o1.o_orderstatus = 'F' and o2.o_orderstatus = 'O' order by 1, 2, 3; o1order o2order o_custkey 23010 52549 91141 234946 25291 34885 302497 109117 133474 434722 83353 9376 613377 107278 143623 646854 135305 134503 717701 98785 127393 855717 50962 88390 857472 91084 97922 874625 39688 102112 902276 130828 21508 1049856 33811 8194 1091458 129698 99907 1185794 110383 63079 1190181 46441 67618 1203046 35158 53731 1255365 71594 107173 1399905 114295 143111 1517600 100157 58531 1552449 23057 19397 1639335 112588 132481 1643075 18527 104261 1656837 104576 63331 1737829 67267 72994 1787520 82414 8737 1837095 50077 43300 1876097 60265 48646 1885254 69845 65795 1939168 21583 12454 1984517 48106 121093 2005603 55738 69730 2160263 25165 52165 2171652 64412 138470 2323621 106978 63367 2330151 66539 54469 2388551 34093 19363 2569185 30046 41092 2700708 88000 12358 2785572 38476 108134 2908514 142355 10084 3172390 91493 31013 3214433 98675 6439 3363171 89218 50245 3395076 76700 96577 3492899 104378 126112 3643973 133907 7367 3891367 18578 142885 3903875 27058 67906 3973414 134476 13060 4100452 148916 98851 4109575 85798 85601 4376420 46057 9799 4390050 15496 46304 4396228 123454 98177 4443042 127456 89728 4513792 102635 144545 4859008 139166 9316 4905731 50830 47077 4969154 140204 142660 5114023 70547 70405 5154438 1627 136930 5188999 31504 60707 5261152 39481 48871 5287876 96251 61312 5383875 15119 48292 5431079 12463 81157 5485507 98152 83875 5520544 15380 45382 5559427 5035 52960 5572069 80473 61795 5615043 17401 65350 5653190 18241 17830 5660774 35158 53731 5765569 1606 16228 5863808 127553 93251