DBI202Xuất hiện trong 1 đề thi
Given two relations: R(A,B,C,D) with the primary key is A, and S(D,E,F) with the unique key is D. How to make a R.D foreign key referencing S.D?
Các lựa chọn
AADD CONSTRAINT fk_R_D FOREIGN KEY R(D) REFERENCES S(D)
BALTER TABLE R
ALTER CONSTRAINT fk_R_D FOREIGN KEY (D) REFERENCES S(D)
CCan not add a foreign key in the R table because the S's D column is not the primary key.
DALTER TABLE R
ADD CONSTRAINT fk_R_D FOREIGN KEY (D) REFERENCES S(D)