-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDBPRJ2_schema.rtf
More file actions
40 lines (39 loc) · 1.21 KB
/
DBPRJ2_schema.rtf
File metadata and controls
40 lines (39 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{\rtf1\ansi\ansicpg949\cocoartf1404\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset129 AppleSDGothicNeo-Regular;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
\f0\fs24 \cf0 create table building(\
id int NOT NULL AUTO_INCREMENT,\
name varchar(200) NOT NULL,\
location varchar(200) NOT NULL,\
capacity int NOT NULL,\
assigned INT NOT NULL,\
primary key(id));\
\
create table performance(\
id int NOT NULL AUTO_INCREMENT,\
name varchar(200) NOT NULL,\
type varchar(200) NOT NULL,\
price int NOT NULL,\
booked int NOT NULL,\
build_id int,\
primary key(id),\
foreign key(build_id) references building(id) ON DELETE
\f1 SET NULL
\f0 );\
\
create table audience(\
id int NOT NULL AUTO_INCREMENT,\
name varchar(200) NOT NULL,\
gender varchar(1) NOT NULL,\
age int NOT NULL,\
primary key(id));\
\
\
create table booked_list(\
performance_id int,\
audience_id int,\
seat_number int,\
foreign key(performance_id) references performance(id) ON DELETE CASCADE,\
foreign key(audience_id) references audience(id) ON DELETE SET NULL);}