|
|||
CREATE TABLE dbo.Subjects ( idSubject int IDENTITY,CREATE TABLE dbo.Subjects ( idSubject int IDENTITY, TitleSubject varchar(50) NOT NULL, CONSTRAINT PK_Subjects PRIMARY KEY (idSubject) ) ON [PRIMARY] GO -- -- Создать таблицу "dbo.Students" -- PRINT (N'Создать таблицу "dbo.Students"') GO CREATE TABLE dbo.Students ( idStudent int IDENTITY, FIOStudent varchar(50) NOT NULL, NumGroup int NOT NULL, CONSTRAINT PK_Students PRIMARY KEY (idStudent) ) ON [PRIMARY] GO -- -- Создать таблицу "dbo.Sessions" -- PRINT (N'Создать таблицу "dbo.Sessions"') GO CREATE TABLE dbo.Sessions ( NumGroup int NOT NULL, NumSemestr int NOT NULL, idSubject int NOT NULL, idTeacher int NOT NULL, Zach_Exam varchar(7) NOT NULL, CONSTRAINT PK_Sessions PRIMARY KEY (NumGroup, NumSemestr, idSubject, idTeacher) ) ON [PRIMARY] GO -- -- Создать таблицу "dbo.Departments" -- PRINT (N'Создать таблицу "dbo.Departments"') GO CREATE TABLE dbo.Departments ( idDepartment int IDENTITY, TitleDepartment varchar(50) NOT NULL, PhoneDepartment varchar(50) NOT NULL, CONSTRAINT PK_Departments PRIMARY KEY (idDepartment) ) ON [PRIMARY] GO -- -- Создать таблицу "dbo.Results" -- PRINT (N'Создать таблицу "dbo.Results"') GO CREATE TABLE dbo.Results ( idStudent int NOT NULL, idSubject int NOT NULL, idTeacher int NOT NULL, DateExam datetime NOT NULL, Balls int NOT NULL, Mark int NOT NULL, NumSemestr int NOT NULL, CONSTRAINT PK_Results PRIMARY KEY (idStudent, idSubject, idTeacher, Num- Semestr) ) ON [PRIMARY] GO -- -- Создать таблицу "dbo.Marks" -- PRINT (N'Создать таблицу "dbo.Marks"') GO
|
|||
|