Query 1: 4032 rows) select * from AllMoves Query 2: 896 rows) select FromSquare, ToSquare from AllMoves where (X = Xi or Y = Yi) Query 3: 560 rows) select FromSquare, ToSquare from AllMoves where abs(X-Xi) = abs(Y-Yi) Query 4: 336 rows) select FromSquare, ToSquare from AllMoves where (abs(X - Xi) = 2 and abs(Y-Yi) = 1) or (abs(X - Xi) = 1 and abs(Y-Yi) = 2) Query 5: 1792 rows) select X, Y, FromSquare, Xi, Yi, ToSquare from AllMoves where (X = Xi or Y = Yi) union all select X, Y, FromSquare, Xi, Yi, ToSquare from AllMoves where abs(X-Xi) = abs(Y-Yi) union all select X, Y, FromSquare, Xi, Yi, ToSquare from AllMoves where (abs(X - Xi) = 2 and abs(Y-Yi) = 1) or (abs(X - Xi) = 1 and abs(Y-Yi) = 2) Query 6: 1792 rows) select X, Y, FromSquare, Xi, Yi, ToSquare from AllMoves where (X = Xi or Y = Yi) --Castle or abs(X-Xi) = abs(Y-Yi) --Bishop or ( (abs(X - Xi) = 2 and abs(Y-Yi) = 1) or (abs(X - Xi) = 1 and abs(Y-Yi) = 2) ) --Knight Query 7: 1456 rows) select FromSquare, ToSquare from AllMoves B where abs(X-Xi) = abs(Y-Yi) union all select FromSquare, ToSquare from AllMoves C where (X = Xi or Y = Yi) Query 8: 424 rows) select FromSquare, ToSquare from AllMoves where abs(X - Xi) < 2 and abs(Y - Yi) < 2 or (Y = Yi and X = 5 and abs(X-Xi) = 2 and Y in (1,8)) Query 9: 324 rows) select FromSquare, ToSquare from AllMoves where Y <> Yi and ( (abs(X - Xi) < 2 and abs(Y - Yi) < 2) or (X=Xi and ((Y = 2 and Yi = 4) or (Y = 7 and Yi = 5))) )