Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please correct my SQL attached, I believe it's the WHERE function because it runs correctly without it but I am not sure how to get
Please correct my SQL attached, I believe it's the WHERE function because it runs correctly without it but I am not sure how to get the desired outcome of the top ranked" Revise the query from the last problem: when there is a tie of quantityrank, assign the same rank to each tied row, but ensure that the next rank in the sequence is not skipped. Filter the results to only show the rows of the top two quantityrank. Hint: consider using subquery. ccustomerfirstname, ccustomerlastname, cpquantity, DENSERANK OVER PARTITION BY ccustomerfirstname, ccustomerlastname FROM customer c JOIN customerpurchases cp ON ccustomerid cpcustomerid; WHERE quantityrank AND ; ORDER BY ccustomerlastname, ccustomerfirstname, quantityrank;
Please correct my SQL attached, I believe it's the WHERE function because it runs correctly without it but I am not sure how to get the desired outcome of the top ranked"
Revise the query from the last problem: when there is a tie of quantityrank, assign
the same rank to each tied row, but ensure that the next rank in the sequence is not
skipped. Filter the results to only show the rows of the top two quantityrank.
Hint: consider using subquery.
ccustomerfirstname,
ccustomerlastname,
cpquantity,
DENSERANK OVER PARTITION BY ccustomerfirstname, ccustomerlastname
FROM
customer c
JOIN customerpurchases cp ON ccustomerid cpcustomerid;
WHERE quantityrank AND ;
ORDER BY
ccustomerlastname,
ccustomerfirstname,
quantityrank;
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