-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.sql
39 lines (36 loc) · 1.01 KB
/
database.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
CREATE DATABASE spacegames;
USE spacegames;
CREATE TABLE Accounts (
ID INT AUTO_INCREMENT PRIMARY KEY,
Username VARCHAR(30) NOT NULL,
Password VARCHAR(50) NOT NULL,
Email VARCHAR(150),
RegisteredOn DATETIME,
LastSeen DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE Stats (
ID INT PRIMARY KEY,
xInRowPlayed INT DEFAULT 0,
xInRowWins INT DEFAULT 0,
xInRowLost INT DEFAULT 0,
xInRowTurns INT DEFAULT 0,
blackJackPlayed INT DEFAULT 0,
blackJackWins INT DEFAULT 0,
blackJackLost INT DEFAULT 0,
blackJackBJ INT DEFAULT 0,
blackJackTurns INT DEFAULT 0,
blackJackHits INT DEFAULT 0,
brickBreakerPlayed INT DEFAULT 0,
brickBreakerWins INT DEFAULT 0,
brickBreakerLost INT DEFAULT 0,
brickBreakerPoints INT DEFAULT 0,
tickCrossPlayed INT DEFAULT 0,
tickCrossWins INT DEFAULT 0,
tickCrossLost INT DEFAULT 0,
g2048Played INT DEFAULT 0,
g2048Wins INT DEFAULT 0,
g2048Lost INT DEFAULT 0,
g2048Points INT DEFAULT 0,
g2048HighestPoints INT DEFAULT 0,
FOREIGN KEY (ID) REFERENCES Accounts(ID) ON UPDATE CASCADE
);