Answered step by step
Verified Expert Solution
Link Copied!

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 9: SELECT (Returning / total)*100 AS retention_rate FROM retu...
SQL state: 42601
Character: 391
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
)
>
1
)
,
SELECT
(
C
.
returning
/
C
.
total
)
*
1
0
0
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions

Question

Identify the characteristics associated with leadership traits. LO2

Answered: 1 week ago

Question

=+What kind of question would you ask to encourage their response?

Answered: 1 week ago

Question

=+Does it keep the visitor reading?

Answered: 1 week ago