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.println("SELECT count(*) FROM point WHERE X >= " + Xs + " AND X <= " + Xe + " AND Y >= " + Ys + " AND Y <= " + Ye); } } }