QuestionQ74

Database Security

Examine this statement and its output:

Question Image

Which two SQL statements can jsmith execute?

Choose two
  • A UPDATE world.country SET Name='all';
  • B UPDATE world.country SET Name='one' LIMIT 1;
  • C UPDATE world.country SET Name='new' WHERE Name='old';
  • D UPDATE world.country SET Name=CONCAT('New ',Name);
  • E UPDATE world.country SET Name='first' ORDER BY Name LIMIT
Explanation

UPDATE(Name) on world.country permits modifying the Name column. An UPDATE also requires SELECT privilege for column values it reads, such as values used in a WHERE condition, assignment expression, or ordering expression. Assigning a constant to Name, with or without a numeric LIMIT, does not read a column value, so the column-level UPDATE privilege is sufficient.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!