From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../Datenbanken 2/Praktikum3/bibcreatemysql.sql | 150 +++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 Bachelor/Datenbanken 2/Praktikum3/bibcreatemysql.sql (limited to 'Bachelor/Datenbanken 2/Praktikum3/bibcreatemysql.sql') diff --git a/Bachelor/Datenbanken 2/Praktikum3/bibcreatemysql.sql b/Bachelor/Datenbanken 2/Praktikum3/bibcreatemysql.sql new file mode 100644 index 0000000..73f11f5 --- /dev/null +++ b/Bachelor/Datenbanken 2/Praktikum3/bibcreatemysql.sql @@ -0,0 +1,150 @@ +/*==============================================================*/ +/* 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) +); + -- cgit v1.2.3