Skip to content
Permalink
Browse files
Add files via upload
  • Loading branch information
shads3 committed Mar 7, 2019
1 parent 092584b commit f134fc90bc732994beafddb08c60feb7ca9c4d06
Showing 1 changed file with 79 additions and 0 deletions.
@@ -0,0 +1,79 @@
Create database racing_boat;
GO

USE racing_boat;
GO

CREATE TABLE Boat
(
Boat_ID nvarchar primary key,
Boat_Description nvarchar(50) Not null,
Boat_Model int,
Boat_Color nvarchar(15)
);
GO
Create table Locations
(
Location_ID int identity(1, 1) PRIMARY KEY,
Location_Name nvarchar(50) not null,
City nvarchar(50),
Country nvarchar(50)
);
GO

Create table Event_Type
(
Event_Type_ID int identity(1, 1) PRIMARY KEY,
Event_Type varchar
);
GO
Create table Event_Details
(
Event_ID int identity(1, 1) PRIMARY KEY,
Event_Description nvarchar(50) Not null,
Event_Start_Date date default current_timestamp,
Event_End_Date date,
Location_ID int,
Event_Type_ID int,
Foreign key(Location_ID) References Locations(Location_ID),
Foreign key(Event_Type_ID) References Event_Type(Event_Type_ID)
);
GO

Create table Event_Phase
(
Phase_ID INT identity(1, 1) PRIMARY KEY,
Phase_Detail nvarchar(50),
Phase_Date Date,
Phase_Start_Time time,
Event_ID int
Foreign key (Event_ID) References Event_Details(Event_ID)
);
GO
Create table Event_Boat
(
Event_ID int,
Boat_ID nvarchar,
Phase_ID INT,
Start_time time,
End_Time time,
toatl_Time_taken time,
Event_Position nvarchar(15),
Primary key(Event_ID, Boat_ID,Phase_ID),
Foreign key (Event_ID) References Event_Details(Event_ID),
Foreign key(Boat_ID) References Boat (Boat_ID),
Foreign key(Phase_ID) References Event_Phase (Phase_ID)
);

Create table Event_Promotion
(
Promotion_id int identity(1, 1),
Promotion_Detail nvarchar(80),
Promotion_Start_Date date,
Promotion_End_Date date,
Promotion_Budget int,
Event_ID int,
Location_ID int,
Foreign key (Event_ID) References Event_Details(Event_ID),
Foreign key(Location_ID) References Locations(Location_ID)
);

0 comments on commit f134fc9

Please sign in to comment.