Professional Documents
Culture Documents
soldaki verilerin hepsi olacak ama sağdaki verilerin hepsi olmak zorunda değil
order by o.id
sağdaki verilerin hepsi olacak ama soldaki verilerin hepsi olmak zorunda değil
bilgiler hangi tablodan alınacak aktarılacak tablo adı hangi bilgiler aktarılacak
Başka tablodan Başka tabloyu güncelleme
delete customers
on orders.customer_id=customers.id
union all ->iki tablodaki verileri sadece 1 defa getirir bütün veriler için ekleriz
ALT SORGULAR
select id,product_name from products where id in (select product_id from order_details where
quantity>100) ->100 den fazla spariş edilen ürünleri göster
select id,first_name from customers c where EXISTS(select id from orders o where c.id=
o.customer_id and payment_type= 'Credit Card') -> doğru olan değerleri yazdırıyor
select id,first_name,last_name from customers c where EXISTS(select count(*) from orders where
c.id=orders.customer_id group by orders.customer_id having count(*)>2)
select id,product_name,list_price from products where id =any (select product_id from order_details
where quantity>10) 10 dan fazla miktarı olan ürünleri göster *or* or*
select id,product_name,list_price from products where id >all (select product_id from order_details
where quantity>10) id si adet idsinden büyük olan ürünleri göster
select * from customers2 where salary>any(select avg(salary) from customers2) maaşı ortalamanın
üzerinde olan kullanıcılar gelir