SELECT * FROM CHECKS WHERE AMOUNT > 100;
SELECT LOCATION AS "WHERE'S WALDO?" FROM PUZZLE WHERE NAME = 'WALDO';
SELECT * FROM CHECKS;
SELECT * FROM CHECKS ORDER BY CHECK#;
SELECT * FROM CHECKS ORDER BY PAYEE DESC;
SELECT PAYEE, AMOUNT FROM CHECKS ORDER BY CHECK# ASC;
SELECT * FROM CHECKS ORDER BY PAYEE, REMARKS;
SELECT * FROM CHECKS ORDER BY REMARKS, PAYEE;
SELECT * FROM CHECKS ORDER BY PAYEE ASC, REMARKS DESC;
SELECT SUM(AMOUNT) FROM CHECKS2;
SELECT PAYEE, SUM(AMOUNT) FROM CHECKS2 GROUP BY PAYEE;
SELECT PAYEE, SUM(AMOUNT), COUNT(PAYEE) FROM CHECKS2 GROUP BY PAYEE;
SELECT PAYEE, SUM(AMOUNT), COUNT(PAYEE) FROM CHECKS2 GROUP BY PAYEE, REMARKS;
SELECT PAYEE, REMARKS FROM CHECKS2 WHERE PAYEE = 'Joans Gas';
SELECT REMARKS, MIN(AMOUNT), MAX(AMOUNT) FROM CHECKS2 GROUP BY REMARKS;
SELECT MIN(AMOUNT), MAX(AMOUNT) FROM CHECKS2 GROUP BY REMARKS;
SELECT PAYEE, MAX(AMOUNT), MIN(AMOUNT) FROM CHECKS2 GROUP BY REMARKS;
SELECT TEAM, AVG(SALARY) FROM ORGCHART GROUP BY TEAM;
SELECT TEAM, AVG(SALARY) FROM ORGCHART WHERE AVG(SALARY) < 38000 GROUP BY TEAM;
SELECT TEAM, AVG(SALARY) FROM ORGCHART GROUP BY TEAM HAVING AVG(SALARY) < 38000;
SELECT TEAM, AVG(SICKLEAVE),AVG(ANNUALLEAVE) FROM ORGCHART GROUP BY TEAM HAVING AVG(SICKLEAVE)>25 AND AVG(ANNUALLEAVE)<20;
SELECT TEAM, AVG(SICKLEAVE),AVG(ANNUALLEAVE) FROM ORGCHART GROUP BY TEAM HAVING COUNT(TEAM) > 1;
SELECT TEAM,MIN(SALARY),MAX(SALARY) FROM ORGCHART GROUP BY TEAM HAVING AVG(SALARY) > 37000 OR MIN(SALARY) > 32000;
SELECT TEAM,AVG(SALARY) FROM ORGCHART GROUP BY TEAM HAVING TEAM IN ('PR','RESEARCH');
SELECT PAYEE, REMARKS FROM CHECKS WHERE PAYEE = 'Cash' OR REMARKS LIKE'Ga%' ORDER BY REMARKS;
SELECT NAME, SALARY FROM ORGCHART WHERE SICKLEAVE < 25 ORDER BY NAME;
SELECT TEAM, AVG(SALARY), AVG(SICKLEAVE), AVG(ANNUALLEAVE) FROM ORGCHART GROUP BY TEAM;
SELECT * FROM ORGCHART WHERE SALARY < 38000 ORDER BY NAME DESC;
SELECT PAYEE, SUM(AMOUNT) TOTAL, COUNT(PAYEE) NUMBER_WRITTEN FROM CHECKS GROUP BY PAYEE HAVING SUM(AMOUNT) > 50;
SELECT PAYEE, SUM(AMOUNT) TOTAL, COUNT(PAYEE) NUMBER_WRITTEN FROM CHECKS WHERE   >= 100 GROUP BY PAYEE HAVING SUM(AMOUNT) > 50;
