GATE 2014 CS (CS1) – Question 32
S1: A foreign-key declaration can always be replaced by an equivalent SQL CHECK assertion. S2: Given R(a,b,c) with primary key (a,b), the following is valid:
CREATE TABLE S (
a INTEGER, d INTEGER, e INTEGER,
PRIMARY KEY (d),
FOREIGN KEY (a) REFERENCES R
);
Which statement is correct?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (D) Both FALSE
Explanation
A row CHECK constraint cannot in general replace referential integrity across tables and preserve its behaviour under updates/deletes. The second declaration supplies one referencing column for a two-column primary key without a matching unique target. It is invalid. Thus **both statements are false, D**.