Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ERROR: syntax error at or near Returning LINE 9 : SELECT ( Returning / total ) * 1 0 0 AS retention _ rate FROM
ERROR: syntax error at or near "Returning"
LINE : SELECT Returning total AS retentionrate FROM retu...
SQL state:
Character:
syntax Error
WITH total
customers AS
SELECT COUNT
DISTINCT customerID
AS total
FROM
JVS
Schema".Customer
returning
customers AS
SELECT COUNT
DISTINCT C
customerID
AS Returning
FROM
JVS
Schema".Customer AS C
JOIN
JVS
Schema".Rental AS R ON R
CustomerID
C
CustomerID
JOIN
JVS
Schema".Order AS O ON R
OrderID
O
OrderID
GROUP BY C
customerID HAVING COUNT
O
OrderID
SELECT
C
returning
C
total
AS retention
rate
FROM returning
customers AS Return, total
customers AS total;
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