-- Benchmark Queries

SET TIMING ON;
-- Q1:
SELECT unique2 FROM r2 s WHERE s.unique1=8530;
SELECT unique2 FROM r2 s WHERE s.unique3=8530;

-- Q2:
SELECT AVG(unique2) FROM r2 s WHERE s.unique1 > 1000;
SELECT AVG(unique2) FROM r2 s WHERE s.unique3 > 1000;

-- Q3:
SELECT AVG(unique1) FROM r2 s WHERE s.unique1 BETWEEN 200 AND 900;
SELECT AVG(unique1) FROM r2 s WHERE s.unique3 BETWEEN 200 AND 900;

-- Q4:
SELECT AVG(r.four+s.four) FROM r1 r, r2 s
WHERE r.unique1=s.unique1 AND s.unique1=8530 AND r.unique1 > 200;

SELECT AVG(r.four+s.four) FROM r1 r, r2 s
WHERE r.unique3=s.unique3 AND s.unique3=8530 AND r.unique3 > 200;

-- Q5
SELECT COUNT(*) FROM r1 r, r2 s
WHERE r.unique1=s.unique1 AND r.unique1 > 700;

SELECT COUNT(*) FROM r1 r, r2 s
WHERE r.unique3=s.unique3 AND r.unique3 > 700;
