Oracle Database MySQL 5.6 Developer — Question 34
A MySQL command- line client is started with safe updates disabled.
Mysql - -safe updates=0 -
What happens when you execute an UPDATE statement without a WHERE clause?
Answer options
- A. Results in an error
- B. Updates every row in the specified table(s)
- C. Results in - -safe-updates being enabled automatically
- D. Causes a syntax error
Correct answer: A
Explanation
When safe updates are disabled, executing an UPDATE statement without a WHERE clause will lead to an error as MySQL protects against unintentional modifications. Other options are incorrect because the absence of a WHERE clause in this case does not automatically enable safe updates, does not cause a syntax error, and does not update every row.