Answered step by step
Verified Expert Solution
Question
1 Approved Answer
is there a way to lower the query cost of this query SELECT s . staff _ id , CONCAT ( s . first _
is there a way to lower the query cost of this query
SELECT
sstaffid
CONCATsfirstname, slastname AS staffname,
SUMpamount AS totalsales
FROM
staff s
LEFT OUTER JOIN
rental r ON sstaffid rstaffid
LEFT OUTER JOIN
payment p ON rrentalid prentalid
LEFT OUTER JOIN
inventory i ON rinventoryid iinventoryid
LEFT OUTER JOIN
film f ON ifilmid ffilmid
WHERE
ppaymentdate IS NOT NULL
AND fdescription LIKE Boring
AND fdescription LIKE Lumberjack
AND fdescription LIKE New Orleans
GROUP BY
sstaffid
staffname
ORDER BY
totalsales DESC;
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