Bitta shaharda yashovchi ham haridori ham ishchisi mavjud shaharlar ro`yxatini topuvchi so`rov yozing


)Amerikada yashovchi eng faol hodimlar haqida ma`lumot shakllantiring



Yüklə 18,55 Kb.
səhifə2/3
tarix02.01.2022
ölçüsü18,55 Kb.
#42476
1   2   3
Databasa

6)Amerikada yashovchi eng faol hodimlar haqida ma`lumot shakllantiring

select * from customers

where customer_id=(select orders.customer_id from customers

join orders

on customers.customer_id=orders.customer_id

where customers.country='USA'

group by orders.customer_id

order by count(*) desc

limit 1)
7)Qaysi davlatdagi hodimlar eng faol ishlashi haqidagi hisobot shakllantiring

select country from customers

where customer_id=(select orders.customer_id from customers

join orders

on customers.customer_id=orders.customer_id

group by orders.customer_id

order by count(*) desc

limit 1)
8)1997-yilda eng ko`p summada buyurtma qilgan haridorlar haqida m`lumot.

select * from customers

where customer_id=(select od.customer_id from public.orders as od

join public.order_details as ordd

on od.order_id=ordd.order_id

where to_char(order_date,'YYYY')='1997'

group by od.customer_id

order by sum(unit_price) desc

limit 1

)


Yüklə 18,55 Kb.

Dostları ilə paylaş:
1   2   3




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin