Section B: Answer the following questions based on the query given SELECT EMP _ _ LNAME, EMP
Fantastic news! We've Found the answer you've been seeking!
Question:
Section B: Answer the following questions based on the query given
SELECT EMP_LNAME, EMP_FNAME, EMP_AREACODE, EMP_GENDER
FROM EMPLOYEE
WHERE EMP_GENDER =F AND EMP_AREACODE =615
ORDER BY EMP_LNAME, EMP_FNAME;
1. What is the likely data sparsity of the EMP_GENDER column?
2. What index would you recommend?
SELECT EMP_LNAME, EMP_FNAME, EMP_DOB, YEAR(EMP_DOB) AS YEAR
FROM EMPLOYEE
WHERE YEAR(EMP_DOB)=1966;
3. What is the likely data sparsity of the EMP_DOB column?
4. What index would you recommend?
SELECT P_CODE, P_PRICE
FROM PRODUCT
WHERE P_PRICE >=(SELECT AVG(P_PRICE) FROM PRODUCT);
5. What is the likely data sparsity of the P_PRICE column?
6. Should you create an index? Why or why not?
SELECT P_CODE, SUM(LINE_UNITS)
FROM LINE
GROUP BY P_CODE
HAVING SUM(LINE_UNITS)>(SELECT MAX(LINE_UNITS) FROM LINE);
7. What is the likely data sparsity of the LINE_UNITS column?
8. Should you create an index? If so, what would the index column(s) be and why would you create that index?
9. Should you create an index on P_CODE? If so, write the SQL command to create that index. If not, explain your reasoning.
Related Book For
Posted Date: