-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathÖdev10-JOIN.sql
More file actions
27 lines (13 loc) · 962 Bytes
/
Ödev10-JOIN.sql
File metadata and controls
27 lines (13 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- Aşağıdaki sorgu senaryolarını dvdrental örnek veri tabanı üzerinden gerçekleştiriniz.
-- city tablosu ile country tablosunda bulunan şehir (city) ve ülke (country) isimlerini birlikte
-- görebileceğimiz LEFT JOIN sorgusunu yazınız.
SELECT city, country from city
left join country on city.country_id= country.country_id;
-- customer tablosu ile payment tablosunda bulunan payment_id ile customer tablosundaki
-- first_name ve last_name isimlerini birlikte görebileceğimiz RIGHT JOIN sorgusunu yazınız.
select payment_id, first_name, last_name from customer
right join payment on customer.customer_id = payment.customer_id;
-- customer tablosu ile rental tablosunda bulunan rental_id ile customer tablosundaki
-- first_name ve last_name isimlerini birlikte görebileceğimiz FULL JOIN sorgusunu yazınız.
select rental_id, first_name, last_name from customer
full join rental on customer.customer_id = rental.customer_id;