GateAI
SQL

GATE CSE 2014 Set 1 · Q22

MCQ1 markMedium

Time

Given the following statements: S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL. S2: Given the table R(a, b, c) where a and b together form the primary key, the following is a valid table definition.CREATE TABLE S ( a INTEGER, d INTEGER, e INTEGER, PRIMARY KEY (d), FOREIGN KEY (a) references R)Which one of the following statements is CORRECT?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: D) Both S1 and S2 are FALSE.

SQL

Let us analyze both statements:

  • Statement S1: Foreign key constraints include referential actions such as ON DELETE CASCADE, ON UPDATE CASCADE, SET NULL, etc., which cannot be expressed using simple CHECK constraints/assertions. Furthermore, table-level CHECK constraints cannot reference columns from other tables. Hence, statement S1 is FALSE.

  • Statement S2: In table R(a,b,c)R(a, b, c), (a,b)(a, b) together form the composite primary key. In SQL, a foreign key in a referencing table must reference the entire primary key or a candidate key (with a UNIQUE constraint) of the referenced table. Referencing only a proper subset attribute a without specifying the full key (a,b)(a, b) is invalid. Hence, statement S2 is FALSE.

Therefore, both S1 and S2 are FALSE, making (D) the correct option.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This SQL previous year question is Q22 of the GATE CSE 2014 Set 1 paper. Find more GATE CSE PYQs on SQL in Databases, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related SQL PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

SQL in GATE CSE

SQL has 17 GATE CSE PYQs across 14 papers from 2011 to 2025. 6 of them are 1-mark MCQs like this one, and GATE CSE 2014 Set 1 has 2.

How GATE tests SQL

More from GATE CSE 2014 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2014 Set 1 · Q22 · MCQ

Given the following statements: S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL. S2: Given the table R(a, b, c) where a and b together form the primary key, the following is a valid table definition. CREATE TABLE S ( a INTEGER, d INTEGER, e INTEGER, PRIMARY KEY (d), FOREIGN KEY (a) references R) Which one of the following statements is CORRECT?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.