-
Notifications
You must be signed in to change notification settings - Fork 86
/
18b.sql
34 lines (33 loc) · 959 Bytes
/
18b.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
SELECT MIN(mi.info) AS movie_budget,
MIN(mi_idx.info) AS movie_votes,
MIN(t.title) AS movie_title
FROM cast_info AS ci,
info_type AS it1,
info_type AS it2,
movie_info AS mi,
movie_info_idx AS mi_idx,
name AS n,
title AS t
WHERE ci.note IN ('(writer)',
'(head writer)',
'(written by)',
'(story)',
'(story editor)')
AND it1.info = 'genres'
AND it2.info = 'rating'
AND mi.info IN ('Horror',
'Thriller')
AND mi.note IS NULL
AND mi_idx.info > '8.0'
AND n.gender IS NOT NULL
AND n.gender = 'f'
AND t.production_year BETWEEN 2008 AND 2014
AND t.id = mi.movie_id
AND t.id = mi_idx.movie_id
AND t.id = ci.movie_id
AND ci.movie_id = mi.movie_id
AND ci.movie_id = mi_idx.movie_id
AND mi.movie_id = mi_idx.movie_id
AND n.id = ci.person_id
AND it1.id = mi.info_type_id
AND it2.id = mi_idx.info_type_id;