Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
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