Emily
2013-01-31 09:23:41 UTC
SQL Query 1: List the ratio of commission to salary for each employee. For employees
with no commission, the value should be 0. (Do NOT use
the NVL function.)
SQL Query 2: List the customer name, order id, and order date for all orders from all
customers. If a customer has placed no orders, there should be null values
for order id and order date.
SQL Query 3: For each product, list the product id, the order id of the order on which
the greatest quantity of that product was purchased. List also the
quantity
Tables are: CUSTOMER(CUST_ID, CUST_NAME, CUST_ADDRESS, CUST_CITY, CUST_STATE, CUST_ZIP, CUST_AREA, CUST_PHONE, CUST_CREDITLIMIT, CUST_COMMENTS, EMP_ID)
TABLE 2: DEPARTMENT (DEPT_NO, DEPT_NAME, DEPT_LOC)
TABLE 3: EMPLOYEE (EMP_ID, EMP_NAME, EMP_JOB, EMP_MGR, EMP_HIREDATE, EMP_SALARY, EMP_COMMISSION, DEPT_NO)
TABLE 4: ORD (ORD_ID, ORD_ORDERDATE, ORD_COMMPLAN, ORD_SHIPDATE, ORD_TOTAL, CUST_ID)
TABLE 5: ORDERITEM (ORDITEM_ID, ORDITEM_ACTPRICE, ORDITEM_QTY, ORDITEM_TOTAL, ORD_ID, PROD_ID)
TABLE 6: PRODUCT (PROD_ID, PROD_DESCRIP)