Add Constraint
rem*****Schlüsselvergabe(Primär- und Fremdschlüssel)
rem*****tblperson
alter table tblperson add constraint con_PK_Person primary key (idp);
rem*****tblmitarbeiter
alter table tblmitarbeiter add constraint con_PK_Mit primary key (idm);
alter table tblmitarbeiter add constraint con_FK_IDP_IDM foreign key (idm)references tblperson(idp);
rem*****tblkunden
alter table tblkunden add constraint con_PK_ku primary key (idk);
alter table tblkunden add constraint con_FK_IDP_IDK foreign key (idk)references tblperson(idp);
rem*****tblFirma
alter table tblFirma add constraint con_PK_FI primary key (idf);
alter table tblFirma add constraint con_FK_IDP_IDF foreign key (idf)references tblperson(idp);
rem****tblSkills
alter table tblSkills add constraint con_PK_Sk primary key (ids);
alter table tblSkills add constraint con_FK_ids_idp foreign key(ids) references tblPerson(idp);
rem*****tbladressen
alter table tbladressen add constraint con_PK_IDA primary key (ida);
alter table tbladressen add constraint con_FK_aidp_pidp foreign key(idp) references tblPerson(idp);
rem*****tblprojekt
alter table tblprojekt add constraint con_PK_IDPRO primary key (idpro);
alter table tblProjekt add constraint con_FK_proidp_pidp foreign key(idp) references tblPerson(idp);
rem*****tblFertigProdukt
alter table tblFertigProdukt add constraint con_PK_IDFP primary key (idfp);
alter table tblFertigProdukt add constraint con_FK_fpidp_pidp foreign key(idp)
references tblPerson(idp);
alter table tblFertigProdukt add constraint con_FK_fppro_proidpro foreign key(FP_pro)
references tblProjekt(IDPRO);
rem*****tblAngebot
alter table tblAngebot add constraint con_PK_IDANG primary key (idang);
alter table tblAngebot add constraint con_FK_Anpro_idpro foreign key(An_Pro) references tblProjekt(IDPRO);
rem*****tblAuftrag
alter table tblAuftrag add constraint con_PK_AUid primary key (au_id);
alter table tblAuftrag add constraint con_FK_Auidang_anidang foreign key(IDANG) references tblAngebot(IDANG);
rem*****tblRechnung
alter table tblRechnung add constraint con_PK_RGid primary key (rg_id);
alter table tblRechnung add constraint con_FK_rauid_auid foreign key(Au_id) references tblAuftrag(Au_id);
rem*****tblMahnung
alter table tblMahnung add constraint con_PK_IDMA primary key (idma);
alter table tblMahnung add constraint con_FK_rrgid_mrgid foreign key(Rg_id) references tblRechnung(Rg_id);
rem*****tblAdmin
alter table tblAdmin add constraint con_PK_IDPRO_IDP primary key (idadmin, idpro);
alter table tblAdmin add constraint con_FK_IDpro_IDpro foreign key (idpro)references tblprojekt(idpro);
alter table tblAdmin add constraint con_FK_IDp_IDadmin foreign key (idadmin)references tblperson(idp);
alter table tblAdmin add constraint con_uq_idpro unique(idpro);
alter table tblAdmin add constraint con_uq_idp unique(idadmin);
rem*****tblBerabeiter
alter table tblBearbeiter add constraint con_fk_Be_IDP foreign key (idp) references tblperson(idp);
alter table tblBearbeiter add constraint con_fk_Be_IDPro foreign key (idpro) references tblProjekt(idpro);
rem*****tblProjektangebot
alter table tblProjektangebot add constraint con_PK_idang_idpro_idp_idpk primary key (idang,idpro,idp,idpk);
alter table tblProjektangebot add constraint con_FK_PA_idang foreign key (idang)references tblangebot(idang);
alter table tblProjektangebot add constraint con_FK_PA_idpro foreign key (idpro)references tblprojekt(idpro);
alter table tblProjektangebot add constraint con_FK_PA_idp foreign key (idp)references tblperson(idp);
alter table tblProjektangebot add constraint con_FK_PA_rek_idp foreign key (idpk)references tblperson(idp);
rem*****tblFrage
alter table tblFrage add constraint con_PK_idfr primary key(IDFR);
alter table tblFrage add constraint con_FK_fridp_pidp foreign key(idp) references tblPerson(idp);
rem*****tblAntwort
alter table tblAntwort add constraint con_PK_IDAN_IDFR_IDP primary key(idan, idfr, idp);
alter table tblAntwort add constraint con_FK_fridfr_aidfr foreign key (idfr) references tblFrage(idfr);
alter table tblAntwort add constraint con_FK_fraidp_pidp foreign key (idp) references tblPerson(idp);
rem*****tblBild
alter table tblBild add constraint con_PK_idb primary key(idb);
alter table tblBild add constraint con_FK_idb_idp foreign key(idb) references tblPerson(idp);
rem*****tblLebenslauf
alter table tblLebenslauf add constraint con_PK_idl primary key(idl);
alter table tblLebenslauf add constraint con_FK_idl_idp foreign key(idl) references tblPerson(idp);