-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathodev_12.sql
More file actions
52 lines (42 loc) · 1.01 KB
/
odev_12.sql
File metadata and controls
52 lines (42 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--film tablosunda film uzunluğu length sütununda gösterilmektedir. Uzunluğu ortalama film uzunluğundan fazla kaç tane film vardır?
select count(*)
from film
where length>
(
select avg(length)
from film
);
--film tablosunda en yüksek rental_rate değerine sahip kaç tane film vardır?
select count(*)
from film
where rental_rate =
(
select max(rental_rate)
from film
);
--film tablosunda en düşük rental_rate ve en düşün replacement_cost değerlerine sahip filmleri sıralayınız.
(select *
from film
where rental_rate =
(
select min(rental_rate)
from film
)
)
intersect
(
select*
from film
where replacement_cost=
(
select min(replacement_cost)
from film
)
);
--payment tablosunda en fazla sayıda alışveriş yapan müşterileri(customer) sıralayınız.
select first_name,last_name,customer.customer_id, Count(customer.customer_id) as total_shopping_number
from payment
join customer
on customer.customer_id = payment.customer_id
group by customer.customer_id
order by Count(customer.customer_id) desc;