-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.sql
31 lines (31 loc) · 940 Bytes
/
db.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
CREATE TABLE rapidity (
idrapidity INT NOT NULL,
RapidityName VARCHAR(50) NULL,
PRIMARY KEY (idrapidity));
CREATE TABLE trust (
idtrust INT NOT NULL,
trustName VARCHAR(50) NULL,
PRIMARY KEY (idtrust));
CREATE TABLE player (
idplayer INT NOT NULL IDENTITY(1,1),
nickname VARCHAR(50) NULL,
idrapidity INT NOT NULL,
idtrust INT NOT NULL,
PRIMARY KEY (idplayer),
FOREIGN KEY (idrapidity) REFERENCES rapidity(idrapidity),
FOREIGN KEY(idtrust) REFERENCES trust(idtrust));
CREATE TABLE status (
idstatus INT NOT NULL,
statusName VARCHAR(50) NULL,
PRIMARY KEY (idstatus));
CREATE TABLE route (
idroute INT NOT NULL IDENTITY(1,1),
distance FLOAT NULL,
time FLOAT NULL,
wazelink VARCHAR(300) NULL,
mapslink VARCHAR(300) NULL,
idplayer INT NOT NULL,
idstatus INT NOT NULL,
PRIMARY KEY (idroute),
FOREIGN KEY(idplayer) REFERENCES player(idplayer),
FOREIGN KEY(idstatus) REFERENCES status(idstatus));