Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. create table sales_orders (
  2. id int primary key,
  3. ...
  4. );
  5.  
  6. create table order_items (
  7. order_id int references sales_orders(id),
  8. line_number smallint,
  9. unit_price decimal(19,4) not null,
  10. quantity smallint not null default 1,
  11. product_id int not null references products(id),
  12. ...
  13.  
  14. primary key (order_id, line_number)
  15. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement