Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
C-Database/CreateDatabaseTables
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
161 lines (74 sloc)
2.59 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [dbo].[Course]( | |
[CourseID] [int] NOT NULL, | |
[CourseCode] [varchar](50) NOT NULL, | |
[CourseName] [varchar](50) NOT NULL, | |
[CourseDesciption] [varchar](255) NOT NULL, | |
[LecturersID] [int] NOT NULL, | |
PRIMARY KEY CLUSTERED | |
( | |
[CourseID] ASC, | |
[LecturersID] ASC | |
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | |
) ON [PRIMARY] | |
GO | |
CREATE TABLE [dbo].[CourseRooms]( | |
[CourseDetailsID] [int] NOT NULL, | |
[RoomsRoomsID] [int] NOT NULL, | |
PRIMARY KEY CLUSTERED | |
( | |
[CourseDetailsID] ASC, | |
[RoomsRoomsID] ASC | |
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | |
) ON [PRIMARY] | |
GO | |
CREATE TABLE [dbo].[Lecturers]( | |
[LecturersID] [int] IDENTITY(1,1) NOT NULL, | |
[FirstName] [varchar](255) NOT NULL, | |
[LastName] [varchar](255) NOT NULL, | |
[EmailAddress] [varchar](255) NULL, | |
[ContactPhone] [int] NULL, | |
PRIMARY KEY CLUSTERED | |
( | |
[LecturersID] ASC | |
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | |
) ON [PRIMARY] | |
GO | |
CREATE TABLE [dbo].[Rooms]( | |
[RoomsID] [int] IDENTITY(1,1) NOT NULL, | |
[RoomNumber] [varchar](25) NOT NULL, | |
[RoomName] [varchar](255) NOT NULL, | |
[RoomType] [int] NOT NULL, | |
[BuildingName] [varchar](255) NOT NULL, | |
PRIMARY KEY CLUSTERED | |
( | |
[RoomsID] ASC | |
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | |
) ON [PRIMARY] | |
GO | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
CREATE TABLE [dbo].[RoomType]( | |
[RoomTypeID] [int] IDENTITY(1,1) NOT NULL, | |
[RoomTypeName] [varchar](50) NOT NULL, | |
PRIMARY KEY CLUSTERED | |
( | |
[RoomTypeID] ASC | |
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | |
) ON [PRIMARY] | |
GO | |
CREATE TABLE [dbo].[TimeTable]( | |
[TimeTableID] [int] NOT NULL, | |
[StartDate] [datetime] NOT NULL, | |
[EndDate] [datetime] NOT NULL, | |
[StartTime] [datetime] NOT NULL, | |
[EndTime] [datetime] NOT NULL, | |
[CourseID] [int] NOT NULL, | |
PRIMARY KEY CLUSTERED | |
( | |
[TimeTableID] ASC, | |
[CourseID] ASC | |
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | |
) ON [PRIMARY] | |
GO |