Skip to content

Instantly share code, notes, and snippets.

@daniellavoie
Created July 18, 2017 09:00
Show Gist options
  • Save daniellavoie/605ab0c55369e7a4f82e030b52e784ba to your computer and use it in GitHub Desktop.
Save daniellavoie/605ab0c55369e7a4f82e030b52e784ba to your computer and use it in GitHub Desktop.
atelier-2-schema.sql
create table invoice (id integer not null auto_increment, date datetime, primary key (id));
create table invoice_detail (id integer not null auto_increment, quantity double precision not null, tax_rate double precision not null, unit_price double precision not null, invoice_id integer, product_ean13 varchar(255), primary key (id));
create table product (ean13 varchar(255) not null, description varchar(255), name varchar(255), price double precision not null, tax_rate double precision not null, primary key (ean13));
alter table invoice_detail add constraint FKit1rbx4thcr6gx6bm3gxub3y4 foreign key (invoice_id) references invoice (id);
alter table invoice_detail add constraint FKdfh10r7yvasbml9570xlc7s7t foreign key (product_ean13) references product (ean13);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment