-
Notifications
You must be signed in to change notification settings - Fork 88
/
11b.sql
31 lines (30 loc) · 860 Bytes
/
11b.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
28
29
30
SELECT MIN(cn.name) AS from_company,
MIN(lt.link) AS movie_link_type,
MIN(t.title) AS sequel_movie
FROM company_name AS cn,
company_type AS ct,
keyword AS k,
link_type AS lt,
movie_companies AS mc,
movie_keyword AS mk,
movie_link AS ml,
title AS t
WHERE cn.country_code !='[pl]'
AND (cn.name LIKE '%Film%'
OR cn.name LIKE '%Warner%')
AND ct.kind ='production companies'
AND k.keyword ='sequel'
AND lt.link LIKE '%follows%'
AND mc.note IS NULL
AND t.production_year = 1998
AND t.title LIKE '%Money%'
AND lt.id = ml.link_type_id
AND ml.movie_id = t.id
AND t.id = mk.movie_id
AND mk.keyword_id = k.id
AND t.id = mc.movie_id
AND mc.company_type_id = ct.id
AND mc.company_id = cn.id
AND ml.movie_id = mk.movie_id
AND ml.movie_id = mc.movie_id
AND mk.movie_id = mc.movie_id;