custOrder

an anonymous user · December 06, 2021 · SQL
-- create a table
CREATE TABLE custOrder (
  orderID serial NOT NULL,
  customerID serial NOT NULL,
  paymentID serial NOT NULL,
  orderDate date NOT NULL,
  paid int(500) NOT NULL,
  paymentDate date NOT NULL,
  shippingDate date NOT NULL,
  PRIMARY KEY (orderID),
  FOREIGN KEY (customerID)
    REFERENCES Customer(customerID)
    ON DELETE CASCADE
  FOREIGN KEY (paymentID)
    REFERENCES Payment(paymentID)
    ON DELETE CASCADE
);

Comments

Please sign up or log in to contribute to the discussion.