Question: SELECT e . first _ name, e . last _ name, t . title, AVG ( s . salary ) AS average _ salary FROM
SELECT
efirstname,
elastname,
ttitle,
AVGssalary AS averagesalary
FROM
employees e
JOIN
salaries s ON eempno sempno
JOIN
titles t ON eempno tempno
JOIN
deptemp de ON eempno deempno
WHERE
sfromdate BETWEEN AND
AND ttodate
AND dedeptno d
GROUP BY
efirstname,
elastname,
ttitle
HAVING
AVGssalarySELECT AVGsalary FROM salaries WHERE fromdate BETWEEN AND
ORDER BY
averagesalary DESC;
a Without using indexes, create histograms on one or many columns that will improve query performance. Show the query cost
and query time prior to the creation of the histograms and after the creation of the histograms
b Explain the results. Were you able to show improvement? Why or why not?
c If the WHERE clause could be modified with a different date range of your choosing, based on the data distribution, could you
achieve better performance?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
