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 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

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions

Question

2. What is the impact of information systems on organizations?

Answered: 1 week ago

Question

Evaluate the impact of technology on HR employee services.

Answered: 1 week ago