BaşlayınÜcretsiz Başlayın

Average rating per customer

Similar to what you just did, you will now look at the average movie ratings, this time for customers. So you will obtain a table with the average rating given by each customer. Further, you will include the number of ratings and the number of movie rentals per customer. You will report these summary statistics only for customers with more than 7 movie rentals and order them in ascending order by the average rating.

Bu egzersiz

Data-Driven Decision Making in SQL

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Group the data in the table renting by customer_id and report the customer_id, the average rating, the number of ratings and the number of movie rentals.
  • Select only customers with more than 7 movie rentals.
  • Order the resulting table by the average rating in ascending order.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

SELECT ___, -- Report the customer_id
      ___,  -- Report the average rating per customer
      ___,  -- Report the number of ratings per customer
      ___  -- Report the number of movie rentals per customer
FROM renting
GROUP BY customer_id
___ -- Select only customers with more than 7 movie rentals
ORDER BY ___; -- Order by the average rating in ascending order
Kodu Düzenle ve Çalıştır