Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Section B: Answer the following questions based on the query given SELECT EMP _ _ LNAME, EMP _ _ FNAME, EMP _ _ AREACODE, EMP
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.
Step by Step Solution
★★★★★
3.32 Rating (155 Votes )
There are 3 Steps involved in it
Step: 1
11 The likely data sparsity of the EMPGENDER column is low This is because there are only two possible values for this column M and F Therefore the da...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started