This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Internal Security: Preventing Unauthorized Filesystem Access”.
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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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()
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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.
Sanfoundry Global Education & Learning Series – MySQL Database.
To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Apply for Programming Internship
- Check MySQL Books
- Practice Programming MCQs
- Check Information Technology Books