Write the correct order of UPDATE command onto the 'employee' table to update the Emp_contact, Emp_sal fields having Emp_id 105.
(A) SET Emp_contact=8985852, Emp_sal=11242
(B) UPDATE employee
(C) WHERE
(D) Emp_id =105
(E) ;
Write the correct order of UPDATE command onto the 'employee' table to update the Emp_contact, Emp_sal fields having Emp_id 105.
(A) SET Emp_contact=8985852, Emp_sal=11242
(B) UPDATE employee
(C) WHERE
(D) Emp_id =105
(E) ;
Solution
An UPDATE statement follows the fixed syntax: UPDATE table SET column=value, ... WHERE condition;
(B) UPDATE employee
(A) SET Emp_contact=8985852, Emp_sal=11242
(C) WHERE
(D) Emp_id =105
(E) ;
Options 2 and 4: the WHERE clause is placed before SET, which is invalid because SET must come right after the table name.
Option 1: starts with SET, but the statement must begin with the UPDATE keyword.
Without the WHERE clause, the UPDATE would change every row in the table.
Related questions:
2026: 19 May Shift 1
2025: 16 May Shift 1