SQL - Using COUNT doubt

Asked

Viewed 17 times

0

Hello, I have the following question: Select the id and the total number of rentals (rental) of the ((a) client (Customer) that made the largest number of rentals.

(tip: use COUNT, MAX, nested subconsulta in FROM and WHERE, rename COUNT(*) using AS and rename nested subconsulta within FROM using AS slide example).

So far I’ve got this:

SELECT rental_id, COUNT(*) AS TOTAL LEASES'

FROM RENTAL, CUSTOMER

WHERE CUSTOMER...

But I’m having a lot of doubts about how to proceed, so if anyone can help out, thanks!

Diagram image: inserir a descrição da imagem aqui

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.