/*==============================================================*/ /* Database name: OBJECTORIENTEDMODEL_1 */ /* DBMS name: MySQL 3.22 */ /* Created on: 22.04.2004 15:03:44 */ /*==============================================================*/ drop table if exists Arrangement; drop table if exists Arrangor; drop table if exists Bestilling; drop table if exists Billettluke; drop table if exists Bygning; drop table if exists Forestilling; drop table if exists Sal; drop table if exists arrangeres_i; drop table if exists benyttes_av; /*==============================================================*/ /* Table: Arrangement */ /*==============================================================*/ create table Arrangement ( ArrID int not null auto_increment, ForeID int not null, Tid int, Dato date, Pris int, primary key (ArrID) ); /*==============================================================*/ /* Table: Arrangor */ /*==============================================================*/ create table Arrangor ( Bnavn varchar(20) not null, Pord varchar(20) not null, primary key (Bnavn) ); /*==============================================================*/ /* Table: Bestilling */ /*==============================================================*/ create table Bestilling ( Refnr int not null auto_increment, ArrID int not null, AntBill int, Hentetid int, Hentet enum ('hentet', 'uhentet'), primary key (Refnr) ); /*==============================================================*/ /* Table: Billettluke */ /*==============================================================*/ create table Billettluke ( Brukernavn varchar(20) not null, ByggID int not null, Passord varchar(20) not null, primary key (Brukernavn) ); /*==============================================================*/ /* Table: Bygning */ /*==============================================================*/ create table Bygning ( ByggID int not null auto_increment, Byggnavn varchar(30), Sted varchar(30), primary key (ByggID) ); /*==============================================================*/ /* Table: Forestilling */ /*==============================================================*/ create table Forestilling ( ForeID int not null auto_increment, Tittel varchar(30), Lengde int, Aldersgrense int, Beskrivelse text, primary key (ForeID) ); /*==============================================================*/ /* Table: Sal */ /*==============================================================*/ create table Sal ( SalID int not null auto_increment, ByggID int not null, Navn varchar(30), Ryddetid int, AntSeter int, primary key (SalID) ); /*==============================================================*/ /* Table: arrangeres_i */ /*==============================================================*/ create table arrangeres_i ( ArrID int not null auto_increment, SalID int not null, primary key (ArrID, SalID) ); /*==============================================================*/ /* Table: benyttes_av */ /*==============================================================*/ create table benyttes_av ( ByggID int not null auto_increment, Bnavn varchar(20) not null, primary key (ByggID, Bnavn) );