-
Notifications
You must be signed in to change notification settings - Fork 0
/
PRACTICE07.sql
27 lines (27 loc) · 1.03 KB
/
PRACTICE07.sql
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
create table films
(film_id int,
film_name varchar(30),
category varchar(30)
);
insert into films values (1, 'Assassins Creed: Embers', 'Animations');
insert into films values (2, 'Real Steel(2012)', 'Animations');
insert into films values (3, 'Alvin and the Chipmunks', 'Animations');
insert into films values (4, 'The Adventures of Tin Tin', 'Animations');
insert into films values (5, 'Safe (2012)', 'Action');
insert into films values (6, 'Safe House(2012)', 'Action');
insert into films values (7, 'Marley and me', 'Romance');
create table actors
(id int,
actor_name varchar(30),
film_id int
);
insert into actors values (1, 'Adam Smith', 1);
insert into actors values (2, 'Ravi Kumar', 2);
insert into actors values (3, 'Susan Davidson', 5);
insert into actors values (4, 'Lee Pong', 6);
insert into actors values (5, 'Bruce Lee', NULL);
-- SORU1: Tüm filmleri, film türlerini ve filimlerde oynayan aktörleri listeleyiniz.
--left ile cozum
select a.film_name ,a.category , b.actor_name from films As a
left join actors as b
on b.film_id=a.film_id;