Machine-translated by Google. Questions are authored in English.
Top

Discussion

Suppose you own a student table, the correct syntax for giving delete privileges to all users of the database with one SQL statement is :

  • A.Grant delete to all on student;
  • B.Grant delete on student to all;
  • C.Grant delete to public on student;
  • D.Grant delete on student to public;

Answer: D

The correct statement is Grant delete on student to public;.

The SQL syntax is GRANT privilege ON object TO grantee. The privilege (DELETE) comes first, then ON and the table name, then TO and the receiver. PUBLIC is the special grantee meaning every user of the database, so a single statement grants the privilege to all users.

'all' is not a grantee name (ALL is used for privileges, as in GRANT ALL), so the option ending 'to all' is wrong, and the two options that place TO before ON have the clauses in the wrong order.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.