-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathniki_mysql
38 lines (6 loc) · 1.64 KB
/
niki_mysql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
create table ni_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) notnull, emp_phone varchar(12) not null, park_code varchar(10) not null, foreign key(park_code) references ni_the_theme_park(park_code));
create table ni_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 ni_the_theme_park(park_code));
create table ni_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 ni_the_theme_park(park_code));
create table ni_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 ni_employee(emp_num), foreign key(attract_no) references ni_attraction(attract_no));
create table ni_sales(transaction_no numeric not null primary key, sale_date date not null, park_code varchar(10) not null, foreign key(park_code) references ni_the_theme_park(park_code));
create table ni_salesline(transaction_no numeric not null, line_no numeric(2) not null, ticket_no numeric(10) not null, line_qty numeric(4) not null, line_pricenumeric(9,2) not null, foreign key(transaction_no) references ni_sales(transaction_no), foreign key(ticket_no) references ni_ticket(ticket_no));