Examine this SQL statement:
Which set of privileges will allow Tom to execute this SQL statement?
Examine this SQL statement:
Which set of privileges will allow Tom to execute this SQL statement?
To execute the given SQL statement, Tom needs the ability to update the 'Population' column in the 'world.city' table and to select data from the 'world.country' table. Therefore, the correct set of privileges includes granting the UPDATE privilege on the 'world.city' table and the SELECT privilege on the 'world.country' table. Option C meets these requirements by providing the necessary privileges to read the required data and perform the update operation accordingly.
The righ answer is C
agree with C. I took the least privileges only. C -> Query OK, 1766 rows affected (0.0211 sec) Rows matched: 1766 Changed: 1766 Warnings: 0 D-> ERROR: 1143: SELECT command denied to user 't***h'@'localhost' for column 'CountryCode' in table 'city'
Sorry for changing my answers. C. read and write to city, read from country, and two columns from country need to be read. Only C works. A won't work because you need to read from two columns in country, not just one. B won't work because you need to read from city. D won't work because you need to read from city as well.
city need to read and write, it needs to read CountryCode. Thus A, all privs includes read. BCD and all work if you just need to update city and read from country.
Not sure why B and C won't work. Especially C, since it includes D