-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgitbasic
34 lines (7 loc) · 1.81 KB
/
gitbasic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
create table sup_theme_park1(park_code varchar(10) not null primary key, park_name varchar(35) not null, park_city varchar(50) not null, park_counter char(2) not null);
create table sup_employee(emp_num numeric(4) not null primary key, emp_title varchar(4) not null, emp_lname varchar(15) not null, emp_fname varchar(15)not null, emp_dob date not null, emp_hire_date date not null, emp_area_code varchar(4) not null, emp_phone varchar(12) not null, park_code varchar(10) not null,foreign key(park_code) references sup_theme_park1(park_code));
create table sup_ticket(ticket_no numeric(10) not null primary key, ticket_price numeric(4,2), ticket_type varchar(10), park_code varchar(10) not null, foreign key(park_code) references sup_theme_park1(park_code));
create table sup_attraction(attract_no numeric(10) not null primary key,attract_name varchar(35), attract_age numeric(3) not null, attract_capacity numeric(3) not null, park_code varchar(10) not null, foreign key(park_code) references sup_theme_park1(park_code));
create table sup_hour(emp_num numeric(4) not null, attract_no numeric(10)not null, hours_per_attract numeric(2) not null, hours_rate numeric(4,2) not null, date_worked date not null, foreign key(emp_num) references sup_employee(emp_num), foreign key(attract_no) references sup_attraction(attract_no));
create table sup_sales(transaction_no numeric not null primary key, sale_date date not null, park_code varchar(10) not null, foreign key(park_code) references sup_theme_park1(park_code));
create table sup_salesline(transaction_no numeric not null, line_no numric(2) not null, ticket_no numeric(10) not null, line_qty numeric(4) not null, line_price numeric(9,2) not null, foreign key(transaction_no) references sup_sales(transaction_no), foreign key(ticket_no) references sup_ticket(ticket_no));