#include using namespace std; int main() { int q; cin >> q; for (int i = 0; i < q; i++) { int xl, xh, yl, yh; cin >> xl >> xh >> yl >> yh; cout << "SELECT count(*) FROM point WHERE x>=" << xl << " AND x<=" << xh << " AND y>=" << yl << " AND y<=" << yh << ";" << endl; } }