The GATE Grind

GATE 2014 CS (CS1) – Question 32

Databases · Integrity Constraints and Normal Forms · 1 mark · Multiple choice

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?

  1. S1 TRUE, S2 FALSE
  2. Both TRUE
  3. S1 FALSE, S2 TRUE
  4. Both FALSE

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**.