Created
July 18, 2017 09:00
-
-
Save daniellavoie/605ab0c55369e7a4f82e030b52e784ba to your computer and use it in GitHub Desktop.
atelier-2-schema.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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