Yes we can.
Check the below code :
CREATE TABLE sal
(
name CHAR(5) PRIMARY KEY,
sal INT
)
CREATE TABLE sal2
(
name CHAR(5),
sal INT PRIMARY KEY
)
CREATE TABLE sal3
(
name CHAR(5),
sal INT
)
ALTER TABLE sal3
ADD CONSTRAINT fk_sal_name FOREIGN KEY(name) REFERENCES sal(name), CONSTRAINT
fk_sal2_sal FOREIGN KEY(sal) REFERENCES sal2(sal)
No comments:
Post a Comment