MySQL MCQ set number 00384

1. To check if the data directory contains insecure files or directories, the command executed is _______
a) ls -l
b) ls -a
c) ls -la
d) ls -lu

Answer

Answer: c [Reason:] It can be determined whether the data directory contains insecure files or directories by executing ‘ls -la’. Then the lookup for files or directories that have the “group” or “other” permissions turned on.

2. What enables the read and execute access to all users outside of mysql group.
a) drwxrwxr-x
b) drwxrwxr-y
c) drwyrwyr-x
d) drwyrwyr-y

Answer

Answer: a [Reason:] Some database directories have the proper permissions like ‘drwx——‘ enables read, write, and execute access to the owner, but no access to anyone else. Other directories have an overly permissive access mode like ‘drwxrwxr-x’.

3. The server uses a Unix domain socket file for connections by clients to localhost.
a) True
b) False

Answer

Answer: a [Reason:] The server uses a Unix domain socket file for connections by clients to localhost. The socket file normally is publicly accessible so that client programs can use it again properly.

4. Which program is used as a utility for MyISAM table maintenance?
a) innochecksum
b) myisam_ftdump
c) myisamchk
d) myisamlog

Answer

Answer: c [Reason:] The program ‘myisamchk’ is a utility for the table maintenance. ‘innochecksum’ is used for offline InnoDB file checksum utility. To display full text index information ‘myisam_ftdump’ is used.

5. What does the AUTO_INCREMENT sequences normally begin at?
a) 0
b) 1
c) -1
d) 2

Answer

Answer: b [Reason:] The AUTO_INCREMENT column attribute provides unique numbers for column identification. AUTO_INCREMENT sequences normally begin at 1 and increase monotonically like 1, 2, 3, and so on.

6. How can the value of recently generated sequence number be obtained?
a) LAST_INSERT_ID()
b) LATEST_INSERT_ID()
c) INITIAL_INSERT_ID()
d) INSERT_ID()

Answer

Answer: a [Reason:] The value of most recently generated sequence number can be obtained by calling the LAST_INSERT_ID() function. This enables to reference the AUTO_INCREMENT value in the subsequent statement.

7. What does LAST_INSERT_ID() return when no AUTO_INCREMENT value has been generated during the current connection?
a) -1
b) 0
c) 1
d) 2

Answer

Answer: b [Reason:] The ‘LAST_INSERT_ID()’ function returns zero when no ‘AUTO_INCREMENT’ value has been generated during the current connection with the server. It is tied to the current connection.

8. Triggers are not supported for _______
a) delete
b) update
c) insert
d) views

Answer

Answer: d [Reason:] In MySQL, the triggers are run only after the table modifications like insert, update and delete are run. Triggers are not supported for views. In order to create a trigger, the CREATE TRIGGER statement is used.

9. Triggers and events are not invoked automatically by the server.
a) True
b) False

Answer

Answer: b [Reason:] The triggers and events are invoked automatically by the server, so the concept of invoking user is not applied. Thus, they have no SQL SECURITY characteristic and always execute with definer privileges.

10. How is a stored procedure invoked?
a) INVOKE
b) SEE
c) CALL
d) RETURN

Answer

Answer: c [Reason:] In MySQL, a stored procedure is invoked using the CALL statement. A stored procedure does not have a return value but can modify its parameters. It also returns some result sets.

ed010d383e1f191bdb025d5985cc03fc?s=120&d=mm&r=g

DistPub Team

Distance Publisher (DistPub.com) provide project writing help from year 2007 and provide writing and editing help to hundreds student every year.