Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

syntax Error WITH total _ customers AS ( SELECT COUNT ( DISTINCT customerID ) AS total FROM JVS _ Schema.Customer ) , returning _

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)*100 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 with AI-Powered 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

Students also viewed these Databases questions