RelationalDesign: kreiranje.sql

File kreiranje.sql, 1.1 KB (added by 148007, 6 weeks ago)
Line 
1create table Clubs(
2ClubID INT primary key,
3ClubName VARCHAR(255) not null
4);
5
6delete Clubs;
7
8create table Players(
9PlayerID INT primary key,
10PlayerName VARCHAR(255) not null,
11clubID INT,
12foreign key (clubID) references clubs(clubid)
13);
14
15delete Players;
16
17create table stadiums(
18stadiumID INT primary key,
19stadiumName VARCHAR(255) not null,
20clubID INT,
21foreign key (clubID) references clubs(clubid)
22);
23
24delete stadiums;
25
26create table injuries(
27InjuryID INT primary key,
28PlayerID INT,
29InjuryType VARCHAR(255) not null,
30InjuryDate DATE,
31foreign key (PlayerID) references Players(Playerid)
32);
33
34delete injuries;
35
36create table cards(
37CardID INT primary key,
38PlayerID INT,
39CardType VARCHAR(255) not null,
40CardDate DATE,
41foreign key (PlayerID) references Players(Playerid)
42);
43
44delete cards;
45
46create table Ratings(
47ID INT primary key,
48Rating1 INT,
49Rating2 INT
50);
51
52delete Ratings;
53
54create table Users(
55ID INT primary key,
56Username VARCHAR(255) not null,
57Password1 VARCHAR(255) not null,
58Email VARCHAR(255) not null
59);
60
61delete Users;
62
63
64
65
66
67