25.06.2025

0

Beğenme

6

Görüntülenme

SQL Kursu Ödev 7

Aşağıdaki sorgu senaryolarını dvdrental örnek veri tabanı üzerinden gerçekleştiriniz.

1- film tablosunda bulunan filmleri rating değerlerine göre gruplayınız.

SELECT rating FROM film

GROUP BY rating;


2- film tablosunda bulunan filmleri replacement_cost sütununa göre grupladığımızda film sayısı 50 den fazla olan replacement_cost değerini ve karşılık gelen film sayısını sıralayınız.

SELECT replacement_cost, COUNT(*) FROM film

GROUP BY replacement_cost

HAVING COUNT(*) > 50

ORDER BY replacement_cost;


3- customer tablosunda bulunan store_id değerlerine karşılık gelen müşteri sayılarını nelerdir? 

SELECT store_id, COUNT(*) FROM customer

GROUP BY store_id;


4- city tablosunda bulunan şehir verilerini country_id sütununa göre gruplandırdıktan sonra en fazla şehir sayısı barındıran country_id bilgisini ve şehir sayısını paylaşınız.

SELECT country_id, COUNT(*) FROM city

GROUP BY country_id

ORDER BY COUNT(*) DESC

LIMIT 1;

SQL

Yorumlar

Kullanıcı yorumlarını görüntüleyebilmek için kayıt olmalısınız!

Şen Ekin

SELECT meaning FROM life WHERE language = 'Python'; | def bio(): return "SQL lover. Python powered."

Konum

DE

© 2021 Patika Dev

facebook
twitter
instagram
youtube
linkedin

Disclaimer: The information /programs / events provided on https://patika.dev and https://risein.com are strictly for upskilling and networking purposes related to the technical infrastructure of blockchain platforms. We do not provide financial or investment advice and do not make any representations regarding the value, profitability, or future price of any blockchain or cryptocurrency. Users are encouraged to conduct their own research and consult with licensed financial professionals before engaging in any investment activities. https://patika.dev and https://risein.com disclaim any responsibility for financial decisions made by users based on information provided here.