Skip to main contentSkip to solution

What will be the correct sequence of the following SQL clauses/snippets when they are used to make modification in the existing data?

(A) attribute = value

(B) SET

(C) UPDATE

(D) tablename

Solution

✅ Correct Option: 4

The SQL syntax for modifying existing data is UPDATE tablename SET attribute = value\texttt{UPDATE tablename SET attribute = value}. The table is named right after UPDATE, and SET then introduces the change.

(C) UPDATE

(D) tablename

(B) SET

(A) attribute = value

Example: UPDATE student SET marks = 90 WHERE roll = 5;\texttt{UPDATE student SET marks = 90 WHERE roll = 5;}


Options 1 and 2: put the table name last, but SQL needs it immediately after UPDATE so the database knows which table to change.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question