-
Notifications
You must be signed in to change notification settings - Fork 88
/
14b.sql
41 lines (40 loc) · 1.13 KB
/
14b.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(mi_idx.info) AS rating,
MIN(t.title) AS western_dark_production
FROM info_type AS it1,
info_type AS it2,
keyword AS k,
kind_type AS kt,
movie_info AS mi,
movie_info_idx AS mi_idx,
movie_keyword AS mk,
title AS t
WHERE it1.info = 'countries'
AND it2.info = 'rating'
AND k.keyword IN ('murder',
'murder-in-title')
AND kt.kind = 'movie'
AND mi.info IN ('Sweden',
'Norway',
'Germany',
'Denmark',
'Swedish',
'Denish',
'Norwegian',
'German',
'USA',
'American')
AND mi_idx.info > '6.0'
AND t.production_year > 2010
AND (t.title LIKE '%murder%'
OR t.title LIKE '%Murder%'
OR t.title LIKE '%Mord%')
AND kt.id = t.kind_id
AND t.id = mi.movie_id
AND t.id = mk.movie_id
AND t.id = mi_idx.movie_id
AND mk.movie_id = mi.movie_id
AND mk.movie_id = mi_idx.movie_id
AND mi.movie_id = mi_idx.movie_id
AND k.id = mk.keyword_id
AND it1.id = mi.info_type_id
AND it2.id = mi_idx.info_type_id;