Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use [master]
- IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = N'BasketballStatistic')
- CREATE DATABASE [BasketballStatistic]
- else
- DROP DATABASE [BasketballStatistic]
- CREATE DATABASE [BasketballStatistic]
- go
- use [BasketballStatistic]
- CREATE TABLE Team
- (
- team_id INT IDENTITY(1,1) NOT NULL,
- team_city VARCHAR(50) NOT NULL,
- team_name VARCHAR(50) NOT NULL,
- team_fondation_date DateTime Not null,
- PRIMARY KEY(team_id)
- );
- CREATE TABLE Players
- (
- player_id INT IDENTITY(1,1) NOT NULL,
- current_team_id int not Null,
- player_name VARCHAR(50) NOT NULL,
- player_surname VARCHAR(50) NOT NULL,
- player_country VARCHAR(50) NOT NULL,
- player_born_date DateTime Not null,
- PRIMARY KEY(player_id)
- );
- CREATE TABLE Contracts
- (
- Contract_id INT IDENTITY(1,1) NOT NULL,
- team_id int not Null,
- player_id int not Null,
- player_number int not Null,
- contract_start_time DateTime not null,
- contract_end_time DateTime not null,
- PRIMARY KEY(Contract_id)
- );
- /**/
- CREATE TABLE Player_statistic
- (
- statistic_id INT IDENTITY(1,1) NOT NULL,
- Contract_id int not Null,
- one_point int not Null,
- two_point int not Null,
- three_point int not Null,
- fols_commited int not null,
- block_shots int not null,
- wins int not null,
- loses int not null,
- draws int not null,
- loses_on_draw int not null,
- wins_on_draw int not null,
- PRIMARY KEY(statistic_id)
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement