-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathproj1.sql
112 lines (96 loc) · 2.17 KB
/
proj1.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
-- Before running drop any existing views
DROP VIEW IF EXISTS q0;
DROP VIEW IF EXISTS q1i;
DROP VIEW IF EXISTS q1ii;
DROP VIEW IF EXISTS q1iii;
DROP VIEW IF EXISTS q1iv;
DROP VIEW IF EXISTS q2i;
DROP VIEW IF EXISTS q2ii;
DROP VIEW IF EXISTS q2iii;
DROP VIEW IF EXISTS q3i;
DROP VIEW IF EXISTS q3ii;
DROP VIEW IF EXISTS q3iii;
DROP VIEW IF EXISTS q4i;
DROP VIEW IF EXISTS q4ii;
DROP VIEW IF EXISTS q4iii;
DROP VIEW IF EXISTS q4iv;
DROP VIEW IF EXISTS q4v;
-- Question 0
CREATE VIEW q0(era)
AS
SELECT 1 -- replace this line
;
-- Question 1i
CREATE VIEW q1i(namefirst, namelast, birthyear)
AS
SELECT 1, 1, 1 -- replace this line
;
-- Question 1ii
CREATE VIEW q1ii(namefirst, namelast, birthyear)
AS
SELECT 1, 1, 1 -- replace this line
;
-- Question 1iii
CREATE VIEW q1iii(birthyear, avgheight, count)
AS
SELECT 1, 1, 1 -- replace this line
;
-- Question 1iv
CREATE VIEW q1iv(birthyear, avgheight, count)
AS
SELECT 1, 1, 1 -- replace this line
;
-- Question 2i
CREATE VIEW q2i(namefirst, namelast, playerid, yearid)
AS
SELECT 1, 1, 1, 1 -- replace this line
;
-- Question 2ii
CREATE VIEW q2ii(namefirst, namelast, playerid, schoolid, yearid)
AS
SELECT 1, 1, 1, 1, 1 -- replace this line
;
-- Question 2iii
CREATE VIEW q2iii(playerid, namefirst, namelast, schoolid)
AS
SELECT 1, 1, 1, 1 -- replace this line
;
-- Question 3i
CREATE VIEW q3i(playerid, namefirst, namelast, yearid, slg)
AS
SELECT 1, 1, 1, 1, 1 -- replace this line
;
-- Question 3ii
CREATE VIEW q3ii(playerid, namefirst, namelast, lslg)
AS
SELECT 1, 1, 1, 1 -- replace this line
;
-- Question 3iii
CREATE VIEW q3iii(namefirst, namelast, lslg)
AS
SELECT 1, 1, 1 -- replace this line
;
-- Question 4i
CREATE VIEW q4i(yearid, min, max, avg)
AS
SELECT 1, 1, 1, 1 -- replace this line
;
-- Question 4ii
CREATE VIEW q4ii(binid, low, high, count)
AS
SELECT 1, 1, 1, 1 -- replace this line
;
-- Question 4iii
CREATE VIEW q4iii(yearid, mindiff, maxdiff, avgdiff)
AS
SELECT 1, 1, 1, 1 -- replace this line
;
-- Question 4iv
CREATE VIEW q4iv(playerid, namefirst, namelast, salary, yearid)
AS
SELECT 1, 1, 1, 1, 1 -- replace this line
;
-- Question 4v
CREATE VIEW q4v(team, diffAvg) AS
SELECT 1, 1 -- replace this line
;