Skip to content

Instantly share code, notes, and snippets.

@chbatey
Created February 17, 2015 14:04
Show Gist options
  • Save chbatey/b1e04f55f8c5f2133426 to your computer and use it in GitHub Desktop.
Save chbatey/b1e04f55f8c5f2133426 to your computer and use it in GitHub Desktop.
create table store(
store_name varchar(32) primary key,
location varchar(32),
store_type varchar(10));
create table staff(
name varchar(32)
primary key,
favourite_colour varchar(32),
job_title varchar(32));
create table customer_events(
id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
customer varchar(12),
time timestamp,
event_type varchar(16),
store varchar(32),
staff varchar(32),
foreign key fk_store(store) references store(store_name),
foreign key fk_staff(staff) references staff(name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment