Jay Fisher

Generate statements (ddl) to create all objects

3 Create statements for my 3 tables generated in ERDplus. Modified the create statement for the Signs table to put in my desired order

  • September 20, 2017 at 11:35 AM
  • Visible to public
CREATE TABLE Materials
(
  mat_id INT NOT NULL,
  name VARCHAR(30) NOT NULL,
  cost FLOAT NOT NULL,
  PRIMARY KEY (mat_id)
);

CREATE TABLE Finishes
(
  finish_id INT NOT NULL,
  name VARCHAR(30) NOT NULL,
  cost FLOAT NOT NULL,
  PRIMARY KEY (finish_id)
);

CREATE TABLE Signs
(
  id INT NOT NULL,
  hor_dimens FLOAT NOT NULL,
  vert_dimens FLOAT NOT NULL,
  mat_id INT NOT NULL,
  finish_id INT NOT NULL,
  quantity INT NOT NULL,
  cost FLOAT NOT NULL,
  PRIMARY KEY (id),
  FOREIGN KEY (finish_id) REFERENCES Finishes(finish_id),
  FOREIGN KEY (mat_id) REFERENCES Materials(mat_id)
);