Home > Net >  How would you create table statement for this er diagram?
How would you create table statement for this er diagram?

Time:12-15

enter image description here

Which attributes would be in the placement table?

How would you write the create table statement if it is one to one relationship? Would this be correct

enter image description here

CodePudding user response:

There is no need to have x and y in the Placement Table and the sid. I would do it like this:

CREATE TABLE Placement (
  pid int NOT NULL,
  is_critical bool,
  PRIMARY KEY (pid),
  FOREIGN KEY (hid) REFERENCES Hold(hid),
  FOREIGN KEY (rid) REFERENCES Route(rid),
  FOREIGN KEY (sid) REFERENCES Slot(sid));
  • Related