forked from qangel/EECS-341-Project
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtables.sql
More file actions
145 lines (137 loc) · 4.83 KB
/
tables.sql
File metadata and controls
145 lines (137 loc) · 4.83 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
DROP TABLE IF EXISTS `jlj`.`weeklystats`;
DROP TABLE IF EXISTS `jlj`.`totalstats`;
DROP TABLE IF EXISTS `jlj`.`teamroster`;
DROP TABLE IF EXISTS `jlj`.`sumwin`;
DROP TABLE IF EXISTS `jlj`.`schedule`;
DROP TABLE IF EXISTS `jlj`.`players`;
DROP TABLE IF EXISTS `jlj`.`countpoints`;
DROP TABLE IF EXISTS `jlj`.`user`;
CREATE TABLE `jlj`.`user` (
`username` char(20) NOT NULL DEFAULT '',
`teamname` char(30) DEFAULT NULL,
`password` char(20) DEFAULT NULL,
`totalpoints` double DEFAULT NULL,
`weekpoints` double DEFAULT NULL,
`rank` int(11) DEFAULT NULL,
`windata` int(11) DEFAULT NULL,
`lossdata` int(11) DEFAULT NULL,
`modes` int(11) DEFAULT NULL,
PRIMARY KEY (`username`),
UNIQUE KEY `rank` (`rank`),
UNIQUE KEY `Teamname` (`teamname`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `jlj`.`countpoints` (
`teamname` char(30) NOT NULL DEFAULT '',
`playername` char(30) NOT NULL DEFAULT '',
`playerposition` char(3) DEFAULT NULL,
`sumweekpoints` double DEFAULT NULL,
`sumtotalpoints` double DEFAULT NULL,
PRIMARY KEY (`teamname`,`playername`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `jlj`.`players` (
`name` char(30) NOT NULL DEFAULT '',
`nflteam` char(30) DEFAULT NULL,
`position` char(3) DEFAULT NULL,
`totalpoints` double DEFAULT NULL,
`weekpoints` double DEFAULT NULL,
`availability` int(10) unsigned DEFAULT NULL,
`injurystate` char(1) DEFAULT NULL,
`owner` char(30) DEFAULT NULL,
PRIMARY KEY (`name`),
KEY `FK_players_1` (`owner`),
CONSTRAINT `FK_players_1` FOREIGN KEY (`owner`) REFERENCES `user` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `jlj`.`schedule` (
`username` char(20) NOT NULL,
`week1` char(20) DEFAULT NULL,
`week2` char(20) DEFAULT NULL,
PRIMARY KEY (`username`),
CONSTRAINT `schedule_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `jlj`.`sumwin` (
`username` char(30) NOT NULL DEFAULT '',
`wins` int(11) DEFAULT NULL,
`losses` int(11) DEFAULT NULL,
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `jlj`.`teamroster` (
`teamname` char(30) NOT NULL DEFAULT '',
`QB` char(30) DEFAULT NULL,
`RB1` char(30) DEFAULT NULL,
`RB2` char(30) DEFAULT NULL,
`WR1` char(30) DEFAULT NULL,
`WR2` char(30) DEFAULT NULL,
`WR3` char(30) DEFAULT NULL,
`TE` char(30) DEFAULT NULL,
`DEF` char(30) DEFAULT NULL,
`K` char(30) DEFAULT NULL,
`BN1` char(30) DEFAULT NULL,
`BN2` char(30) DEFAULT NULL,
`BN3` char(30) DEFAULT NULL,
`BN4` char(30) DEFAULT NULL,
`BN5` char(30) DEFAULT NULL,
PRIMARY KEY (`teamname`),
KEY `QB` (`QB`),
KEY `RB1` (`RB1`),
KEY `RB2` (`RB2`),
KEY `WR1` (`WR1`),
KEY `WR2` (`WR2`),
KEY `WR3` (`WR3`),
KEY `TE` (`TE`),
KEY `DEF` (`DEF`),
KEY `K` (`K`),
KEY `BN1` (`BN1`),
KEY `BN2` (`BN2`),
KEY `BN3` (`BN3`),
KEY `BN4` (`BN4`),
KEY `BN5` (`BN5`),
CONSTRAINT `FK_teamroster_1` FOREIGN KEY (`teamname`) REFERENCES `user` (`teamname`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `jlj`.`totalstats` (
`name` char(30) NOT NULL DEFAULT '',
`passTD` double DEFAULT NULL,
`passyards` double DEFAULT NULL,
`interceptions` double DEFAULT NULL,
`rushTD` double DEFAULT NULL,
`rushyards` double DEFAULT NULL,
`fumbles` double DEFAULT NULL,
`receivingTD` double DEFAULT NULL,
`receivingyards` double DEFAULT NULL,
`pointsallowed` double DEFAULT NULL,
`turnovers` double DEFAULT NULL,
`sacks` double DEFAULT NULL,
`defensiveTD` double DEFAULT NULL,
`fieldgoalless40` double DEFAULT NULL,
`fieldgoalgreater40` double DEFAULT NULL,
`missedfieldgoaless40` double DEFAULT NULL,
`missedfieldgoalgreater40` double DEFAULT NULL,
`PAT` double DEFAULT NULL,
`missedPAT` double DEFAULT NULL,
`calpoints` double DEFAULT NULL,
PRIMARY KEY (`name`),
CONSTRAINT `totalstats_ibfk_1` FOREIGN KEY (`name`) REFERENCES `players` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `jlj`.`weeklystats` (
`name` char(30) NOT NULL DEFAULT '',
`passTD` double DEFAULT NULL,
`passyards` double DEFAULT NULL,
`interceptions` double DEFAULT NULL,
`rushTD` double DEFAULT NULL,
`rushyards` double DEFAULT NULL,
`fumbles` double DEFAULT NULL,
`receivingTD` double DEFAULT NULL,
`receivingyards` double DEFAULT NULL,
`pointsallowed` double DEFAULT NULL,
`turnovers` double DEFAULT NULL,
`sacks` double DEFAULT NULL,
`defensiveTD` double DEFAULT NULL,
`fieldgoalless40` double DEFAULT NULL,
`fieldgoalgreater40` double DEFAULT NULL,
`missedfieldgoaless40` double DEFAULT NULL,
`missedfieldgoalgreater40` double DEFAULT NULL,
`PAT` double DEFAULT NULL,
`missedPAT` double DEFAULT NULL,
`calpoints` double DEFAULT NULL,
PRIMARY KEY (`name`),
CONSTRAINT `weeklystats_ibfk_1` FOREIGN KEY (`name`) REFERENCES `players` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;