/*==============================================================*/ /* Database name: OBJECTORIENTEDMODEL_1 */ /* DBMS name: MySQL 3.23 */ /* Created on: 04.05.2004 13:06:01 */ /*==============================================================*/ 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 Plass; drop table if exists Sal; drop table if exists arrangeres_i; drop table if exists inneholder; /*==============================================================*/ /* Table: Arrangement */ /*==============================================================*/ create table Arrangement ( ArrID int not null, ForeID int not null, Tid int, Dato date, Pris int, primary key (ArrID) ); /*==============================================================*/ /* Table: Arrangor */ /*==============================================================*/ create table Arrangor ( Bnavn char(20) not null, Pord char(20), primary key (Bnavn) ); /*==============================================================*/ /* Table: Bestilling */ /*==============================================================*/ create table Bestilling ( Refnr int not null, ArrID int not null, AntBill int, Hentetid int, primary key (Refnr) ); /*==============================================================*/ /* Table: Billettluke */ /*==============================================================*/ create table Billettluke ( Brukernavn char(20) not null, ByggID int not null, Passord char(20), primary key (Brukernavn) ); /*==============================================================*/ /* Table: Bygning */ /*==============================================================*/ create table Bygning ( ByggID int not null, Bnavn char(20) not null, Byggnavn char(20), Sted char(20), primary key (ByggID) ); /*==============================================================*/ /* Table: Forestilling */ /*==============================================================*/ create table Forestilling ( ForeID int not null, Tittel text, Lengde int, Aldersgrense int, Beskrivelse text, Type enum('kino', 'teater', 'konsert'), primary key (ForeID) ); /*==============================================================*/ /* Table: Plass */ /*==============================================================*/ create table Plass ( PlassID int not null, SalID int, Setenr int, Radnr int, primary key (PlassID) ); /*==============================================================*/ /* Table: Sal */ /*==============================================================*/ create table Sal ( SalID int not null, ByggID int not null, Navn text, Ryddetid int, AntSeter int, primary key (SalID) ); /*==============================================================*/ /* Table: arrangeres_i */ /*==============================================================*/ create table arrangeres_i ( ArrID int not null, SalID int not null, primary key (ArrID, SalID) ); /*==============================================================*/ /* Table: inneholder */ /*==============================================================*/ create table inneholder ( Refnr int not null, PlassID int not null, Status enum('reservert', 'kjopt'), primary key (Refnr, PlassID) );