Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE version(
- id INTEGER NOT NULL,
- PRIMARY KEY(id)
- );
- CREATE TABLE team(
- team_id INTEGER NOT NULL AUTO_INCREMENT,
- name VARCHAR(62) UNIQUE NOT NULL,
- PRIMARY KEY(team_id)
- );
- CREATE TABLE player(
- player_id VARCHAR(62) NOT NULL,
- name VARCHAR(62) UNIQUE NOT NULL,
- PRIMARY KEY(player_id)
- );
- CREATE TABLE teamplayers(
- team_id INTEGER NOT NULL,
- player_id VARCHAR(62) NOT NULL,
- start_date DATE NOT NULL,
- end_date DATE NOT NULL,
- FOREIGN KEY(team_id)
- REFERENCES team(team_id),
- FOREIGN KEY (player_id)
- REFERENCES player(player_id)
- );
- CREATE TABLE season(
- season_id INTEGER NOT NULL,
- start_date DATE NOT NULL,
- end_date DATE NOT NULL,
- PRIMARY KEY(season_id)
- );
- CREATE TABLE seasonteams(
- season_id INTEGER NOT NULL,
- team_id INTEGER NOT NULL,
- FOREIGN KEY(team_id)
- REFERENCES team(team_id),
- FOREIGN KEY(season_id)
- REFERENCES season(season_id)
- );
- CREATE TABLE game(
- game_id INTEGER UNIQUE NOT NULL AUTO_INCREMENT,
- home_id INTEGER NOT NULL,
- away_id INTEGER NOT NULL,
- home_score INTEGER,
- away_score INTEGER,
- server VARCHAR(10) NOT NULL,
- poff_round INTEGER,
- map VARCHAR(10) NOT NULL,
- date DATE NOT NULL,
- PRIMARY KEY(game_id),
- FOREIGN KEY(home_id)
- REFERENCES team(team_id),
- FOREIGN KEY(away_id)
- REFERENCES team(team_id)
- );
- CREATE TABLE seasongames(
- season_id INTEGER NOT NULL,
- game_id INTEGER NOT NULL,
- FOREIGN KEY(season_id)
- REFERENCES season(season_id),
- FOREIGN KEY(game_id)
- REFERENCES game(game_id)
- );
- CREATE TABLE half(
- match_id INTEGER UNIQUE NOT NULL AUTO_INCREMENT,
- game_id INTEGER NOT NULL,
- home_score INTEGER,
- away_score INTEGER,
- red_team VARCHAR(62),
- blue_team VARCHAR(62),
- PRIMARY KEY(match_id),
- FOREIGN KEY(game_id)
- REFERENCES game(game_id)
- );
- CREATE TABLE playermatch(
- match_id INTEGER NOT NULL,
- player VARCHAR(62) NOT NULL,
- minutes INTEGER NOT NULL,
- score INTEGER NOT NULL,
- tags INTEGER NOT NULL,
- pops INTEGER NOT NULL,
- grabs INTEGER NOT NULL,
- drops INTEGER NOT NULL,
- hold INTEGER NOT NULL,
- captures INTEGER NOT NULL,
- prevent INTEGER NOT NULL,
- returns INTEGER NOT NULL,
- support INTEGER NOT NULL,
- FOREIGN KEY(match_id)
- REFERENCES half(match_id),
- FOREIGN KEY(player)
- REFERENCES player(name)
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement