Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. CREATE TABLE price (
  2. start_price decimal(4,2) NOT NULL,
  3. price_date timestamp,
  4. PRIMARY KEY (start_price, price_date)
  5. );
  6.  
  7. CREATE TABLE pricechange (
  8. start_price decimal(4,2) NOT NULL,
  9. new_price decimal(4,2) NOT NULL,
  10. price_date date NOT NULL,
  11. reason varchar(100),
  12. FOREIGN KEY (start_price, price_date)
  13. REFERENCES price(start_price, price_date)
  14. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement