summaryrefslogtreecommitdiffstats
path: root/Bachelor/Datenbanken 2/Praktikum3/bibcreate.sql
diff options
context:
space:
mode:
Diffstat (limited to 'Bachelor/Datenbanken 2/Praktikum3/bibcreate.sql')
-rw-r--r--Bachelor/Datenbanken 2/Praktikum3/bibcreate.sql279
1 files changed, 279 insertions, 0 deletions
diff --git a/Bachelor/Datenbanken 2/Praktikum3/bibcreate.sql b/Bachelor/Datenbanken 2/Praktikum3/bibcreate.sql
new file mode 100644
index 0000000..ef2ace1
--- /dev/null
+++ b/Bachelor/Datenbanken 2/Praktikum3/bibcreate.sql
@@ -0,0 +1,279 @@
+/*==============================================================*/
+/* Database name: CONCEPTUALDATAMODEL_1 */
+/* DBMS name: ORACLE Version 9i */
+/* Created on: 29.03.2006 09:46:49 */
+/*==============================================================*/
+
+
+alter table AUDIO
+ drop constraint FK_AUDIO_INHERITAN_LEIHOBJE
+/
+
+
+alter table AUSLEIHE
+ drop constraint FK_AUSLEIHE_RELATIONS_LEIHOBJE
+/
+
+
+alter table AUSLEIHE
+ drop constraint FK_AUSLEIHE_RELATIONS_ENTLEIHE
+/
+
+
+alter table AUTOR_BUCH
+ drop constraint FK_AUTOR_BU_AUTOR_BUC_BUCH
+/
+
+
+alter table AUTOR_BUCH
+ drop constraint FK_AUTOR_BU_AUTOR_BUC_AUTOR
+/
+
+
+alter table BUCH
+ drop constraint FK_BUCH_INHERITAN_LEIHOBJE
+/
+
+
+alter table ZEITSCHRIFT
+ drop constraint FK_ZEITSCHR_INHERITAN_LEIHOBJE
+/
+
+
+drop index RELATIONSHIP_4_FK
+/
+
+
+drop index RELATIONSHIP_5_FK
+/
+
+
+drop index AUTOR_BUCH2_FK
+/
+
+
+drop index AUTOR_BUCH_FK
+/
+
+
+drop table AUDIO cascade constraints
+/
+
+
+drop table AUSLEIHE cascade constraints
+/
+
+
+drop table AUTOR cascade constraints
+/
+
+
+drop table AUTOR_BUCH cascade constraints
+/
+
+
+drop table BUCH cascade constraints
+/
+
+
+drop table ENTLEIHER cascade constraints
+/
+
+
+drop table LEIHOBJEKT cascade constraints
+/
+
+
+drop table ZEITSCHRIFT cascade constraints
+/
+
+
+/*==============================================================*/
+/* Table: AUDIO */
+/*==============================================================*/
+
+
+create table AUDIO (
+ LEIHNR CHAR(10) not null,
+ KATEGORIE CHAR(2),
+ ATITEL VARCHAR2(30),
+ constraint PK_AUDIO primary key (LEIHNR)
+)
+/
+
+
+/*==============================================================*/
+/* Table: AUSLEIHE */
+/*==============================================================*/
+
+
+create table AUSLEIHE (
+ LEIHNR CHAR(10) not null,
+ ENR CHAR(10) not null,
+ DATUM DATE not null,
+ BACKDATE DATE,
+ OVER INTEGER,
+ constraint PK_AUSLEIHE primary key (LEIHNR, ENR, DATUM)
+)
+/
+
+
+/*==============================================================*/
+/* Index: RELATIONSHIP_4_FK */
+/*==============================================================*/
+create index RELATIONSHIP_4_FK on AUSLEIHE (
+ LEIHNR ASC
+)
+/
+
+
+/*==============================================================*/
+/* Index: RELATIONSHIP_5_FK */
+/*==============================================================*/
+create index RELATIONSHIP_5_FK on AUSLEIHE (
+ ENR ASC
+)
+/
+
+
+/*==============================================================*/
+/* Table: AUTOR */
+/*==============================================================*/
+
+
+create table AUTOR (
+ ACODE CHAR(7) not null,
+ ANAME VARCHAR2(20),
+ constraint PK_AUTOR primary key (ACODE)
+)
+/
+
+
+/*==============================================================*/
+/* Table: AUTOR_BUCH */
+/*==============================================================*/
+
+
+create table AUTOR_BUCH (
+ LEIHNR CHAR(10) not null,
+ ACODE CHAR(7) not null,
+ constraint PK_AUTOR_BUCH primary key (LEIHNR, ACODE)
+)
+/
+
+
+/*==============================================================*/
+/* Index: AUTOR_BUCH_FK */
+/*==============================================================*/
+create index AUTOR_BUCH_FK on AUTOR_BUCH (
+ LEIHNR ASC
+)
+/
+
+
+/*==============================================================*/
+/* Index: AUTOR_BUCH2_FK */
+/*==============================================================*/
+create index AUTOR_BUCH2_FK on AUTOR_BUCH (
+ ACODE ASC
+)
+/
+
+
+/*==============================================================*/
+/* Table: BUCH */
+/*==============================================================*/
+
+
+create table BUCH (
+ LEIHNR CHAR(10) not null,
+ ISBN CHAR(15),
+ BTITEL VARCHAR2(30),
+ ERSCHJAHR INTEGER,
+ constraint PK_BUCH primary key (LEIHNR)
+)
+/
+
+
+/*==============================================================*/
+/* Table: ENTLEIHER */
+/*==============================================================*/
+
+
+create table ENTLEIHER (
+ ENR CHAR(10) not null,
+ ENAME VARCHAR2(20),
+ constraint PK_ENTLEIHER primary key (ENR)
+)
+/
+
+
+/*==============================================================*/
+/* Table: LEIHOBJEKT */
+/*==============================================================*/
+
+
+create table LEIHOBJEKT (
+ LEIHNR CHAR(10) not null,
+ LEIHTYP CHAR(1) not null,
+ constraint PK_LEIHOBJEKT primary key (LEIHNR)
+)
+/
+
+
+/*==============================================================*/
+/* Table: ZEITSCHRIFT */
+/*==============================================================*/
+
+
+create table ZEITSCHRIFT (
+ LEIHNR CHAR(10) not null,
+ JAHRGANG INTEGER,
+ ZTITEL VARCHAR2(30),
+ constraint PK_ZEITSCHRIFT primary key (LEIHNR)
+)
+/
+
+
+alter table AUDIO
+ add constraint FK_AUDIO_INHERITAN_LEIHOBJE foreign key (LEIHNR)
+ references LEIHOBJEKT (LEIHNR)
+/
+
+
+alter table AUSLEIHE
+ add constraint FK_AUSLEIHE_RELATIONS_LEIHOBJE foreign key (LEIHNR)
+ references LEIHOBJEKT (LEIHNR)
+/
+
+
+alter table AUSLEIHE
+ add constraint FK_AUSLEIHE_RELATIONS_ENTLEIHE foreign key (ENR)
+ references ENTLEIHER (ENR)
+/
+
+
+alter table AUTOR_BUCH
+ add constraint FK_AUTOR_BU_AUTOR_BUC_BUCH foreign key (LEIHNR)
+ references BUCH (LEIHNR)
+/
+
+
+alter table AUTOR_BUCH
+ add constraint FK_AUTOR_BU_AUTOR_BUC_AUTOR foreign key (ACODE)
+ references AUTOR (ACODE)
+/
+
+
+alter table BUCH
+ add constraint FK_BUCH_INHERITAN_LEIHOBJE foreign key (LEIHNR)
+ references LEIHOBJEKT (LEIHNR)
+/
+
+
+alter table ZEITSCHRIFT
+ add constraint FK_ZEITSCHR_INHERITAN_LEIHOBJE foreign key (LEIHNR)
+ references LEIHOBJEKT (LEIHNR)
+/
+
+