/*==============================================================*/ /* Database name: CONCEPTUALDATAMODEL_1 */ /* DBMS name: MySQL 3.23 - noch ohne FK-Constraints! */ /* Created on: 23.04.2006 20:43:53 */ /*==============================================================*/ drop index RELATIONSHIP_4_FK on AUSLEIHE; drop index RELATIONSHIP_5_FK on AUSLEIHE; drop index AUTOR_BUCH2_FK on AUTOR_BUCH; drop index AUTOR_BUCH_FK on AUTOR_BUCH; drop table if exists AUDIO; drop table if exists AUSLEIHE; drop table if exists AUTOR; drop table if exists AUTOR_BUCH; drop table if exists BUCH; drop table if exists ENTLEIHER; drop table if exists LEIHOBJEKT; drop table if exists ZEITSCHRIFT; /*==============================================================*/ /* Table: AUDIO */ /*==============================================================*/ create table if not exists AUDIO ( LEIHNR char(10) not null, KATEGORIE char(2), ATITEL varchar(30), primary key (LEIHNR) ); /*==============================================================*/ /* Table: AUSLEIHE */ /*==============================================================*/ create table if not exists AUSLEIHE ( LEIHNR char(10) not null, ENR char(10) not null, DATUM date not null, BACKDATE date, OVER int, primary key (LEIHNR, ENR, DATUM) ); /*==============================================================*/ /* Index: RELATIONSHIP_4_FK */ /*==============================================================*/ create index RELATIONSHIP_4_FK on AUSLEIHE ( LEIHNR ); /*==============================================================*/ /* Index: RELATIONSHIP_5_FK */ /*==============================================================*/ create index RELATIONSHIP_5_FK on AUSLEIHE ( ENR ); /*==============================================================*/ /* Table: AUTOR */ /*==============================================================*/ create table if not exists AUTOR ( ACODE char(7) not null, ANAME varchar(20), primary key (ACODE) ); /*==============================================================*/ /* Table: AUTOR_BUCH */ /*==============================================================*/ create table if not exists AUTOR_BUCH ( LEIHNR char(10) not null, ACODE char(7) not null, primary key (LEIHNR, ACODE) ); /*==============================================================*/ /* Index: AUTOR_BUCH_FK */ /*==============================================================*/ create index AUTOR_BUCH_FK on AUTOR_BUCH ( LEIHNR ); /*==============================================================*/ /* Index: AUTOR_BUCH2_FK */ /*==============================================================*/ create index AUTOR_BUCH2_FK on AUTOR_BUCH ( ACODE ); /*==============================================================*/ /* Table: BUCH */ /*==============================================================*/ create table if not exists BUCH ( LEIHNR char(10) not null, ISBN char(15), BTITEL varchar(30), ERSCHJAHR int, primary key (LEIHNR) ); /*==============================================================*/ /* Table: ENTLEIHER */ /*==============================================================*/ create table if not exists ENTLEIHER ( ENR char(10) not null, ENAME varchar(20), primary key (ENR) ); /*==============================================================*/ /* Table: LEIHOBJEKT */ /*==============================================================*/ create table if not exists LEIHOBJEKT ( LEIHNR char(10) not null, LEIHTYP char(1) not null, primary key (LEIHNR) ); /*==============================================================*/ /* Table: ZEITSCHRIFT */ /*==============================================================*/ create table if not exists ZEITSCHRIFT ( LEIHNR char(10) not null, JAHRGANG int, ZTITEL varchar(30), primary key (LEIHNR) );