1

Struggling with this issue i have. have been given a ERD that looks like this:

ERD Diagram

I am not sure how to join the 2nd Weak Entity (Charge Details) Below is the SQL that is throwing an error when attempting to insert data.

CREATE TABLE Charge_Details
(
actid NUMBER NOT NULL,
empid NUMBER NOT NULL,
weekno NUMBER (2),
hrsworked NUMBER (4,1),
PRIMARY KEY (actid, empid, hrswork),
FOREIGN KEY (actid) REFERENCES ACTOR,
FOREIGN KEY (empid) REFERENCES EMPLOYEE_DETAILS
);

Any help would be hugely appreciated!

Lachie White
  • 1,246
  • 2
  • 14
  • 21

1 Answers1

0

Fixed it, silly mistake!

PRIMARY KEY (actid, empid, weekno)

thats what i need.

Lachie White
  • 1,246
  • 2
  • 14
  • 21