CREATE TABLE DekanatSchema.Chair (
Chair_ID int PRIMARY KEY,
Chair_NAME varchar(20) NOT NULL,
Chair_PHONE varchar (10) ,
Chair_CHIEF varchar (15)
) ;
Создание таблицы Преподаватели:
CREATE TABLE DekanatSchema.Teacher (
Teach_ID bigint not null PRIMARY KEY ,
Teach_FAM varchar (20) NOT NULL,
Teach_IMYA varchar (10),
Teach_OTCH varchar (15),
Teach_POSITION varchar (18),
Teach_STEPEN varchar (12)
Chair_ID int NOT NULL
) ;
Создание таблицы Предметы:
CREATE TABLE StudySchema.Subjects (
Subj_ID int PRIMARY KEY ,
Subj_NAME varchar(20) NOT NULL,
Total_Hours int,
Lection_Hours int,
Practice_Hours int,
Labor_Hours int,
) ;
Создание таблицы Учебный план:
CREATE TABLE StudySchema.Study (
Grup_ID int NOT NULL REFERENCES
StudySchema.Grup(Grup_ID ) ON DELETE CASCADE,
Subj_ID int NOT NULL REFERENCES StudySchema.Subjects (Subj_ID),
Teach_ID bigint NOT NULL REFERENCES DekanatSchema.Teacher (Teach_ID),
Kredit_count int,
Lesson_Hours int not null,
CONSTRAINT PK_Study PRIMARY KEY (Grup_ID, Subj_ID, Teach_ID)
) ;
Создание таблицы Успеваемость:
CREATE TABLE StudySchema.Progress (
Stud_ID bigint not null FOREIGN KEY REFERENCES StudySchema.Students (Stud_ID),
Grup_ID int not null,
Subj_ID int not null,
Teach_ID bigint not null,
Kredit_count int FOREIGN KEY REFERENCES StudySchema.Study (Kredit_count)
Pr_DATE datetime null,
Достарыңызбен бөлісу: |