


//1
select * from movie where eng_title is null or trim(eng_title) = '';
//2
select * from movie where eng_title is null or length(trim(eng_title)) = 0;

select * from movie where country = '한국'
and pub_year = 2001
and genre like '%액션%';

select birth from actor where domain = '감독' and name in(
select director from movie where production like '%싸이더스%' and pub_year = 2020
);

//1
select distinct domain from actor where domain is not null and trim(domain) <> '';
//2
select domain from actor where domain is not null and trim(domain) <> ''
group by domain;

select m.title, m.director, m.pub_year, m.genre
from movie m
join actor a on (m.director = a.name and a.domain = '감독')
where m.pub_year > 2020 and a.country = '독일'
order by m.pub_year desc;

select f.title,
case
when ifnull(f.eng_title, '') = '' then f.title
else f.eng_title
end as eng_title
, f.continent, f.country, f.city,
case
when ifnull(f.gerne, '') = '' then '기타'
else f.gerne
end as gerne
,f.important_flag,
case
when ifnull(f.homepage, '') = '' then '홈페이지 없음'
else f.homepage
end as homepage
from festival f where country = '미국' and city = '시카고';

select row_number() over (order by max(seat_count) desc) as ranking,
biz_name, max(seat_count) as max_seat_count
from screen where biz_name is not null and trim(biz_name) <> ''
group by biz_name order by max_seat_count desc;

select case
when ifnull(country, '') = '' then '국가 미상'
else country
end as country
, count(*) as movie_count from movie group by country order by movie_count desc;

select * from screen where biz_name like '%CJ%' order by screen_count desc limit 5;

select * from screen where screen_count in(
select max(screen_count) from screen
);
