Last active
March 19, 2024 10:14
-
-
Save TheRamsay/f697fd18ce71a544144e232edd4ea76a to your computer and use it in GitHub Desktop.
Ids konzultace
This file contains hidden or 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 TypProgramu | |
( | |
popisTypu nvarchar2(255) primary key, | |
constraint popisTypu_check check(popisTypu in ('bakalářské studium', 'magisterské studium', 'doktorské studium')) | |
); | |
create table Osoba | |
( | |
cisloOsoby int primary key, | |
jmeno nvarchar2(255) not null, | |
prijmeni nvarchar2(255) not null, | |
ulice nvarchar2(255) not null, | |
mesto nvarchar2(255) not null, | |
psc int not null | |
); | |
create table Student | |
( | |
cisloOsoby int primary key REFERENCES Osoba(cisloOsoby) ON DELETE CASCADE, | |
rocnik int not null, | |
email varchar2(255) not null | |
); | |
create table Ustav | |
( | |
zkratkaUstavu varchar2(10) primary key, | |
nazev nvarchar2(255) not null | |
); | |
create table Ucitel | |
( | |
cisloOsoby int primary key REFERENCES Osoba(cisloOsoby) ON DELETE CASCADE, | |
cisloKancelare int not null, | |
zkratkaUstavu varchar2(10) REFERENCES Ustav(zkratkaUstavu) | |
); | |
create table Modul | |
( | |
kodModulu varchar2(10) primary key, | |
nazev nvarchar2(255) not null, | |
pocetKreditu int not null, | |
cisloVedouciho int REFERENCES Ucitel(cisloOsoby) | |
); | |
create table Program | |
( | |
kodProgramu int primary KEY, | |
jmeno nvarchar2(255) not null, | |
typProgramu nvarchar2(255) REFERENCES TypProgramu(popisTypu) | |
); | |
create table StudentuvProgram | |
( | |
cisloOsoby int REFERENCES Student(cisloOsoby), | |
kodProgramu int REFERENCES Program(kodProgramu), | |
primary key (cisloOsoby, kodProgramu) | |
); | |
create table StudentuvModul | |
( | |
cisloOsoby int REFERENCES Student(cisloOsoby), | |
kodModulu varchar2(10) REFERENCES Modul(kodModulu), | |
vyslednaZnamka varchar(1) not null, | |
rokZapisu int not null, | |
primary key (cisloOsoby, kodModulu, rokZapisu) | |
); | |
create table ModulyProgramu | |
( | |
kodModulu varchar2(10) REFERENCES Modul(kodModulu), | |
kodProgramu int REFERENCES Program(kodProgramu), | |
primary key (kodModulu, kodProgramu), | |
jePovinny number(1) not NULL, | |
CONSTRAINT jePovinny_check check(jePovinny in (0,1)) | |
); | |
create table ModulyUcitele | |
( | |
cisloOsoby int REFERENCES Ucitel(cisloOsoby), | |
kodModulu varchar2(10) REFERENCES Modul(kodModulu), | |
primary key (cisloOsoby, kodModulu) | |
); | |
create table Prerekvizita | |
( | |
kodPrerekvizity varchar2(10) REFERENCES Modul(kodModulu), | |
kodModulu varchar2(10) REFERENCES Modul(kodModulu), | |
primary key (kodPrerekvizity, kodModulu) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment