Below the DDLs, with two tables there is no problem.
I sent you the relevant DDLs.
Thank you for your help.
Regards
create table FAK (BEZ VARCHAR(70) NOT NULL , FAK INTEGER NOT NULL , ZEUGNISBEZ VARCHAR(100) , KURZBEZ VARCHAR(5) , PERSON INTEGER NOT NULL );
create table STUDIENGANG (BEZ VARCHAR(50) , STUDIENGANG INTEGER NOT NULL , APNR VARCHAR(20) , MAGISTER INTEGER );
create table STUDAB (STUDFACH VARCHAR(5) NOT NULL , STUDAB INTEGER NOT NULL , REIHENFOLGE VARCHAR(10) );
create table STUDABVER (STUDFACH VARCHAR(5) NOT NULL , STUDAB INTEGER NOT NULL , STUDABVER INTEGER NOT NULL , BEZ VARCHAR(100) NOT NULL);
create table STUDENT (MATRNR INTEGER NOT NULL , VORNAME VARCHAR(50) , NACHNAME VARCHAR(50) , SEX INTEGER NOT NULL , NUTZER VARCHAR(50) , ORT1 VARCHAR(50) );
create table STUDENTFACH (MATRNR INTEGER NOT NULL , STUDFACH VARCHAR(5) NOT NULL , FACHSEM INTEGER NOT NULL , STATUS INTEGER NOT NULL , IMMASEM INTEGER , EXMASEM INTEGER , IMMAFACHSEM INTEGER , ABSCHLUSS INTEGER , POAKTUELL INTEGER NOT NULL , IMMADATUM DATE , EXMADATUM DATE , HAUPTFACH INTEGER , FACHSEMDELTA INTEGER , UNIV INTEGER NOT NULL , ABSCHLUSSAUFBAU INTEGER , NFS INTEGER , APNR VARCHAR(20) , APABSCHLUSS VARCHAR(20) , APSTGNR VARCHAR(2) , SATZUNG INTEGER DEFAULT -1);
create table STUDENTVER (MATRNR INTEGER NOT NULL , STUDFACH VARCHAR(5) NOT NULL , STUDAB INTEGER NOT NULL , STUDABVER INTEGER NOT NULL , STUDENTFACH VARCHAR(5) NOT NULL , NOTE_ FIXED(5,2) , ID_TA INTEGER , SEMESTER_BEGINN INTEGER , NOTEUSER VARCHAR(50) , NOTEZEIT TIME , NOTEDATUM DATE , NUTZER VARCHAR(50) , ZEITSTEMPEL TIMESTAMP , PO INTEGER NOT NULL , SEMESTER_ENDE INTEGER , LOGIN_ VARCHAR(50) , KREDITFREI_ALT INTEGER , VLG INTEGER , KREDIT FIXED(8,2) , KREDITFREIWILLIG FIXED(8,2) , ZUSATZSEMESTER INTEGER , ANERKSEMESTER INTEGER );
alter table STUDFACH ADD PRIMARY KEY ( STUDFACH ) ;
alter table FAK ADD PRIMARY KEY ( FAK ) ;
alter table STUDIENGANG ADD PRIMARY KEY ( STUDIENGANG ) ;
alter table STUDABVER ADD PRIMARY KEY ( STUDFACH, STUDAB, STUDABVER ) ;
alter table STUDABVER ADD PRIMARY KEY ( STUDFACH, STUDAB, STUDABVER ) ;
alter table STUDENT ADD PRIMARY KEY ( MATRNR ) ;
alter table STUDENTFACH ADD PRIMARY KEY ( MATRNR, STUDFACH ) ;
alter table STUDENTVER ADD PRIMARY KEY ( STUDENTFACH, MATRNR, STUDFACH, STUDAB, STUDABVER ) ;
alter table STUDFACH add foreign key (FAK) references FAK(FAK ) ;
alter table STUDFACH add foreign key (STUDIENGANG) references STUDIENGANG(STUDIENGANG ) ;
alter table STUDAB add foreign key (STUDFACH) references STUDFACH(STUDFACH ) ;
alter table STUDABVER add foreign key (STUDFACH, STUDAB) references STUDAB(STUDFACH, STUDAB ) ;
alter table STUDENTFACH add foreign key (STUDFACH) references STUDFACH(STUDFACH ) ;
alter table STUDENTFACH add foreign key (MATRNR) references STUDENT(MATRNR ) ;
alter table STUDENTVER add foreign key (MATRNR, STUDENTFACH) references STUDENTFACH(MATRNR, STUDFACH ) ;
alter table STUDENTVER add foreign key (STUDFACH, STUDAB, STUDABVER) references STUDABVER (STUDFACH, STUDAB, STUDABVER ) ;
|