forked from viktorleis/job
-
Notifications
You must be signed in to change notification settings - Fork 0
/
23b.sql
40 lines (40 loc) · 1.13 KB
/
23b.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
31
32
33
34
35
36
37
38
39
40
SELECT min(kt.kind) AS movie_kind,
min(t.title) AS complete_nerdy_internet_movie
FROM complete_cast AS cc,
comp_cast_type AS cct1,
company_name AS cn,
company_type AS ct,
info_type AS it1,
keyword AS k,
kind_type AS kt,
movie_companies AS mc,
movie_info AS mi,
movie_keyword AS mk,
title AS t
WHERE cct1.kind = 'complete+verified'
AND cn.country_code = '[us]'
AND it1.info = 'release dates'
AND k.keyword in ('nerd',
'loner',
'alienation',
'dignity')
AND kt.kind in ('movie')
AND mi.note like '%internet%'
AND mi.info like 'USA:% 200%'
AND t.production_year > 2000
AND kt.id = t.kind_id
AND t.id = mi.movie_id
AND t.id = mk.movie_id
AND t.id = mc.movie_id
AND t.id = cc.movie_id
AND mk.movie_id = mi.movie_id
AND mk.movie_id = mc.movie_id
AND mk.movie_id = cc.movie_id
AND mi.movie_id = mc.movie_id
AND mi.movie_id = cc.movie_id
AND mc.movie_id = cc.movie_id
AND k.id = mk.keyword_id
AND it1.id = mi.info_type_id
AND cn.id = mc.company_id
AND ct.id = mc.company_type_id
AND cct1.id = cc.status_id;