Re: CANNOT ADD FOREIGN KEY CONSTRAIN
The Data Types used in Foreign Key relationships must be
the same in both Tables:
CREATE TABLE Coffeeshop
( Shop_id INT UNSIGNED NOT NULL
, . . .
, PRIMARY KEY (Shop_id)
);
CREATE TABLE employee
( . . .
, Employee_Shop_Id INT
, . . .
);
ALTER TABLE Employee
. . .
ADD CONSTRAINT checks
FOREIGN KEY (Employee_Shop_Id) REFERENCES Coffeeshop (Shop_Id)
Regards, Phill W.
Subject
Written By
Posted
December 05, 2021 08:49PM
Re: CANNOT ADD FOREIGN KEY CONSTRAIN
December 06, 2021 09:20AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.