GateAI
Integrity Constraints and Normal Forms

GATE CSE 2017 Set 2 · Q19

NAT1 markEasy

Time

Consider the following tables T1 and T2. In table T1, P\mathbf{P} is the primary key and Q\mathbf{Q} is the foreign key referencing R\mathbf{R} in table T2 with on-delete cascade and on-update cascade. In table T2, R\mathbf{R} is the primary key and S\mathbf{S} is the foreign key referencing P\mathbf{P} in table T1 with on-delete set NULL and on-update cascade. In order to delete record ⟨3,8⟩\langle 3, 8\rangle from table T1, the number of additional records that need to be deleted from table T1 is _________.

GATE CSE 2017 Set 2 Q19 diagram

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 0 (±0)

Integrity Constraints and Normal Forms

Let us trace the referential actions triggered by deleting record ⟨3,8⟩\langle 3, 8 \rangle from table T1T1:

  1. In T1T1, PP is the primary key. Deleting record ⟨3,8⟩\langle 3, 8 \rangle means deleting the tuple with P=3P = 3.

  2. Table T2T2 has a foreign key SS referencing PP in T1T1 with ON DELETE SET NULL.

  3. Looking at table T2T2, the tuple referencing P=3P = 3 is ⟨8,3⟩\langle 8, 3 \rangle (where R=8,S=3R = 8, S = 3).

  4. Due to ON DELETE SET NULL, the value of SS in record ⟨8,3⟩\langle 8, 3 \rangle of T2T2 is updated to NULL (it becomes ⟨8,NULL⟩\langle 8, \text{NULL} \rangle). No tuple is deleted from T2T2.

  5. Since no tuples are deleted from T2T2, no cascading delete back to table T1T1 is triggered.

Therefore, no additional records need to be deleted from table T1T1. The number of additional records deleted is 0.

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 Integrity Constraints and Normal Forms previous year question is Q19 of the GATE CSE 2017 Set 2 paper. Find more GATE CSE PYQs on Integrity Constraints and Normal Forms 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 Integrity Constraints and Normal Forms 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.

Integrity Constraints and Normal Forms in GATE CSE

Integrity Constraints and Normal Forms has 30 GATE CSE PYQs across 20 papers from 2011 to 2026. 4 of them are 1-mark NAT questions like this one, and it is the only one in GATE CSE 2017 Set 2.

How GATE tests Integrity Constraints and Normal Forms

More from GATE CSE 2017 Set 2

Share this solution

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

GateAI solution cardGATE CSE 2017 Set 2 · Q19 · NAT

Consider the following tables T1 and T2. In table T1, P is the primary key and Q is the foreign key referencing R in table T2 with on-delete cascade and on-update cascade. In table T2, R is the primary key and S is the foreign key referencing P in table T1 with on-delete set NULL and on-update cascade. In order to delete record 3, 8 from table T1, the number of additional records that need to be deleted from table T1 is …

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.