SELECT * FROM ORDERS WHERE PARTNUM = ( SELECT PARTNUM FROM PART WHERE DESCRIPTION LIKE 'ROAD%' );
SELECT PARTNUM FROM PART WHERE DESCRIPTION LIKE 'ROAD%';
SELECT * FROM ORDERS WHERE PARTNUM = 76;
SELECT O.ORDEREDON, O.PARTNUM, P.DESCRIPTION, O.QUANTITY, O.REMARKS FROM ORDERS O, PART P WHERE O.PARTNUM = P.PARTNUM AND O.PARTNUM = (SELECT PARTNUM FROM PART WHERE DESCRIPTION LIKE 'ROAD%');
SELECT PARTNUM FROM PART WHERE DESCRIPTION LIKE 'ROAD%';
SELECT O.ORDEREDON, O.PARTNUM, P.DESCRIPTION, O.QUANTITY, O.REMARKS FROM ORDERS O, PART P WHERE O.PARTNUM = P.PARTNUM AND O.PARTNUM = (SELECT PARTNUM FROM PART WHERE DESCRIPTION = 'ROAD BIKE');
SELECT O.ORDEREDON, O.PARTNUM, P.DESCRIPTION, O.QUANTITY, O.REMARKS FROM ORDERS O, PART P WHERE O.PARTNUM = P.PARTNUM AND O.PARTNUM = (SELECT PARTNUM FROM PART WHERE DESCRIPTION LIKE 'ROAD%');
SELECT PARTNUM FROM PART WHERE DESCRIPTION LIKE 'ROAD%';
SELECT O.ORDEREDON, O.PARTNUM, P.DESCRIPTION, O.QUANTITY, O.REMARKS FROM ORDERS O, PART P WHERE O.PARTNUM = P.PARTNUM AND O.PARTNUM = (SELECT PARTNUM FROM PART WHERE DESCRIPTION = 'ROAD BIKE');
SELECT AVG(O.QUANTITY * P.PRICE) FROM ORDERS O, PART P WHERE O.PARTNUM = P.PARTNUM;
SELECT O.NAME, O.ORDERED, O.QUANTITY * P.PRICE TOTAL FROM ORDERS O, PART P WHERE O.PARTNUM = P.PARTNUM AND O.QUANTITY * P.PRICE  > (SELECT AVG(O.QUANTITY * P.PRICE) FROM ORDERS O, PART P WHERE O.PARTNUM = P.PARTNUM); 
SELECT C.NAME, C.ADDRESS, C.STATE, C.ZIP FROM CUSTOMER C WHERE C.NAME IN (SELECT O.NAME FROM ORDERS O, PART P WHERE O.PARTNUM = P.PARTNUM AND O.QUANTITY * P.PRICE > (SELECT AVG(O.QUANTITY * P.PRICE) FROM ORDERS O, PART P WHERE O.PARTNUM = P.PARTNUM) );
SELECT O.NAME FROM ORDERS O, PART P WHERE O.PARTNUM = P.PARTNUM AND O.QUANTITY * P.PRICE  > (SELECT AVG(O.QUANTITY * P.PRICE) FROM ORDERS O, PART P WHERE O.PARTNUM = P.PARTNUM); 
SELECT NAME, AVG(QUANTITY) FROM ORDERS GROUP BY NAME HAVING AVG(QUANTITY) > (SELECT AVG(QUANTITY) FROM ORDERS);
SELECT NAME, AVG(QUANTITY) FROM ORDERS GROUP BY NAME;
SELECT AVG(QUANTITY) FROM ORDERS;
SELECT * FROM ORDERS O WHERE 'ROAD BIKE' = (SELECT DESCRIPTION FROM PART P WHERE P.PARTNUM = O.PARTNUM);
SELECT * FROM ORDERS;
SELECT O.ORDERED, O.NAME, O.PARTNUM, O.QUANTITY, O.REMARKS FROM ORDERS O, PART P WHERE P.PARTNUM = O.PARTNUM AND P.DESCRIPTION = 'ROAD BIKE';
SELECT * FROM ORDERS O WHERE 'ROAD BIKE' = (SELECT PRICE FROM PART P WHERE P.PARTNUM = O.PARTNUM);
SELECT * FROM ORDERS O WHERE 'ROAD BIKE' = (SELECT * FROM PART P WHERE P.PARTNUM = O.PARTNUM);


SELECT NAME, ORDERED FROM ORDERS WHERE EXISTS (SELECT * FROM ORDERS WHERE NAME ='TRUE WHEEL');
SELECT NAME, ORDERED FROM ORDERS WHERE EXISTS (SELECT * FROM ORDERS WHERE NAME ='MOSTLY HARMLESS');
SELECT NAME, ORDERED FROM ORDERS O WHERE EXISTS (SELECT * FROM CUSTOMER C WHERE STATE ='NE' AND C.NAME = O.NAME);
SELECT NAME, ORDERED FROM ORDERS WHERE NAME = ANY (SELECT NAME FROM ORDERS WHERE NAME ='TRUE WHEEL');
SELECT NAME, ORDERED FROM ORDERS WHERE NAME IN (SELECT NAME FROM ORDERS WHERE NAME ='TRUE WHEEL');
SELECT NAME, ORDERED FROM ORDERS WHERE NAME > ANY (SELECT NAME FROM ORDERS WHERE NAME ='JACKS BIKE');
SELECT NAME, ORDERED FROM ORDERS WHERE NAME <> ALL (SELECT NAME FROM ORDERS WHERE NAME ='JACKS BIKE');
