What is the result?

You have access to a MySQL 5.6 database with the SELECT ,INSERT, and DELETE
privileges on all tables in the mydb database.
The mydb database.
The mydb t1 table has five rows of data.
You use the statement below to remove all rows in the t1 table:
Mysql> TRUNCATE TABLE mysql.t1;
What is the result?

You have access to a MySQL 5.6 database with the SELECT ,INSERT, and DELETE
privileges on all tables in the mydb database.
The mydb database.
The mydb t1 table has five rows of data.
You use the statement below to remove all rows in the t1 table:
Mysql> TRUNCATE TABLE mysql.t1;
What is the result?

A.
The command succeeds and o rows are affected.

B.
The command succeeds and five rows are affected.

C.
The command fails owing to syntax error.

D.
The command fails owing to permissions error.



Leave a Reply 6

Your email address will not be published. Required fields are marked *


Auriemma Francesco

Auriemma Francesco

correct is D, you don’t have Drop and Create permissions

Jay

Jay

Answer is A.

From MySQL 5.0 Certification Study Guide by Dubois, Hinz, and Pedersen:
“Whereas TRUNCATE TABLES always removes all records.”

…Nothing about create (thats the replace statement which require the INSERT & DELETE… which the person has).

“TRUNCATE TABLE is like DELETE in that it deletes records, so it requires the DELETE privilege.”

… since you have the delete privilege, you got the truncate privilege.