import sys def solve(): q = int(sys.stdin.readline()) for i in range(q): x1, x2, y1, y2 = map(int, sys.stdin.readline().split()) query = 'SELECT count(*) FROM point WHERE ' query += '{} <= x AND x <= {} AND {} <= y AND y <= {};'.format(x1, x2, y1, y2) print(query, flush=True)