nerdexam
CIW

1D0-541 · Question #101

Consider the Recreation relation in the exhibit. A data operation that changes one of the tuples for Student_ID 1003 must be performed. It is necessary to change one of the activities from swimming…

The correct answer is C. UPDATE Recreation. See the full explanation below for the reasoning.

Question

Consider the Recreation relation in the exhibit. A data operation that changes one of the tuples for Student_ID 1003 must be performed. It is necessary to change one of the activities from swimming to tennis. The Student_ID and Activity attributes make up the primary key for the Recreation relation. All related information must be altered, as well. Which SQL statement or statements would best accomplish this?

Options

  • AUPDATE Recreation
  • BUPDATE TABLE Recreation
  • CUPDATE Recreation
  • DDELETE Activity

How the community answered

(26 responses)
  • A
    4% (1)
  • B
    8% (2)
  • C
    85% (22)
  • D
    4% (1)

Community Discussion

5
Renata O.Renata O.Oct 24, 2025

The correct answer is C. When the primary key is involved in a change, you cannot simply UPDATE that column in place because the Activity attribute is part of the composite primary key, so the right approach is to DELETE the old row for Student_ID 1003 with swimming and INSERT a new row with tennis, which is what option C specifies as a paired DELETE and INSERT statement.

14
Mei-Ling H.Mei-Ling H.Nov 7, 2025

The trap here is option B, which adds the word TABLE after UPDATE, and that is not valid SQL syntax, so eliminate it immediately. Because Activity is part of the primary key, a plain UPDATE alone cannot safely change that value without violating key integrity, which is why C is correct as it represents the DELETE-plus-INSERT pair the question hints at when it says "statement or statements."

5
Fatima Z.Fatima Z.Oct 28, 2025

I almost went with A because my brain saw UPDATE and stopped reading, classic trap, but then I remembered the DIP rule, Delete Insert when Primary key fields change, and since Activity is part of the composite key you cannot just UPDATE it in place, you have to DELETE the old row and INSERT the new one, which is exactly what C walks you through.

4
Renata O.Renata O.Oct 30, 2025

The mnemonic is handy but worth noting the deeper reason behind it, which is that changing a primary key column mid-row risks breaking any foreign key references pointing at that row, so the DELETE plus INSERT pattern (ideally wrapped in a transaction) keeps referential integrity clean rather than leaving orphaned child records.

0
Wesley A.Wesley A.Oct 17, 2025

C, but why not DELETE plus INSERT when Activity is part of the key?

1
Full 1D0-541 Practice