import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); for (int i = 0; i < N; i++) { int Xs = Integer.parseInt(sc.next()); int Xe = Integer.parseInt(sc.next()); int Ys = Integer.parseInt(sc.next()); int Ye = Integer.parseInt(sc.next()); System.out.printf("SELECT count(x) FROM point WHERE X BETWEEN %d and %d and Y BETWEEN %d and %d\n", Xs, Xe, Ys, Ye); } } }