-
Notifications
You must be signed in to change notification settings - Fork 0
/
database_creation.sql
79 lines (73 loc) · 2.53 KB
/
database_creation.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
-- Database Creation: Authored by Anusha
CREATE DATABASE GameStatsDB;
-- Players Table Creation Authored by Anusha
CREATE TABLE IF NOT EXISTS Players (
player_id VARCHAR(32) NOT NULL,
password VARCHAR(50) NOT NULL,
PRIMARY KEY (player_id)
);
-- SoloStats Table Creation Authored by Anusha
CREATE TABLE IF NOT EXISTS SoloStats (
stats_id INT NOT NULL,
player_id VARCHAR(32) NOT NULL,
score INT NOT NULL,
top1 INT NOT NULL,
kill_death_ratio INT NOT NULL,
matches_count INT NOT NULL,
kills INT NOT NULL,
minutes_played INT NOT NULL,
PRIMARY KEY (stats_id),
FOREIGN KEY (player_id) REFERENCES Players(player_id) ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- DuosStats Table Creation Authored by Anusha
CREATE TABLE IF NOT EXISTS DuosStats (
stats_id INT NOT NULL,
player_id VARCHAR(32) NOT NULL,
score INT NOT NULL,
top1 INT NOT NULL,
kill_death_ratio INT NOT NULL,
matches_count INT NOT NULL,
kills INT NOT NULL,
minutes_played INT NOT NULL,
PRIMARY KEY (stats_id),
FOREIGN KEY (player_id) REFERENCES Players(player_id) ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- TriosStats Table Creation Authored by Anusha
CREATE TABLE IF NOT EXISTS TriosStats (
stats_id INT NOT NULL,
player_id VARCHAR(32) NOT NULL,
score INT NOT NULL,
top1 INT NOT NULL,
kill_death_ratio INT NOT NULL,
matches_count INT NOT NULL,
kills INT NOT NULL,
minutes_played INT NOT NULL,
PRIMARY KEY (stats_id),
FOREIGN KEY (player_id) REFERENCES Players(player_id) ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- SquadsStats Table Creation Authored by Anusha
CREATE TABLE IF NOT EXISTS SquadsStats (
stats_id INT NOT NULL,
player_id VARCHAR(32) NOT NULL,
score INT NOT NULL,
top1 INT NOT NULL,
kill_death_ratio INT NOT NULL,
matches_count INT NOT NULL,
kills INT NOT NULL,
minutes_played INT NOT NULL,
PRIMARY KEY (stats_id),
FOREIGN KEY (player_id) REFERENCES Players(player_id) ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- LTMStats Table Creation Authored by Anusha
CREATE TABLE IF NOT EXISTS LTMStats (
stats_id INT NOT NULL,
player_id VARCHAR(32) NOT NULL,
score INT NOT NULL,
top1 INT NOT NULL,
kill_death_ratio INT NOT NULL,
matches_count INT NOT NULL,
kills INT NOT NULL,
minutes_played INT NOT NULL,
PRIMARY KEY (stats_id),
FOREIGN KEY (player_id) REFERENCES Players(player_id) ON UPDATE NO ACTION ON DELETE NO ACTION
);