This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “General Preventative Maintenance”.
1. What attempts auto recovery based on the contents of its serial log?
Explanation: When the Falcon storage engine is enabled, it attempts the auto recovery based on the contents of its serial log. If the InnoDB storage engine is enabled, it checks for a variety of problems automatically.
2. How many of these can replace ‘level’ in ‘–myisam-recover = level’?
BACKUP, FORCE, QUICK
Explanation: To enable MyISAM table recovery, the server is started with the ‘–myisam-recover = level’ option. The value of level is a comma-separated list of the following: BACKUP, FORCE, QUICK or DEFAULT.
3. Under which option are index changes not flushed until tables close?
Explanation: In MySQL, the MyISAM recovery is important if the server is run with the ‘–delay-key-write’ option. Under this condition, the index changes are not flushed until the tables close.
4. Which option suppresses output unless there are errors in the table?
Explanation: In MySQL, the ‘–silent’ option suppresses the output unless there are errors in the tables. The ‘cron’ jobs typically generate a mail message if a job produces any output at all.
5. What is the variable that is a handle to a database object?
Explanation: The variable named ‘$dbh’ is a handle to an open file. ‘$h’ is a generic handle and the meaning depends on context. ‘$dbh’ is a handle to a database object. ‘$sth’ is a handle to a query object.
6. The variable that returns code from operations that return true or false is _____________
Explanation: The Perl Non-handle variable ‘$rc’ returns code from operations that return true or false. ‘$rv’ returns value from operations that return an integer. ‘$rows’ returns value from operations that return a row count.
7. Which statement is used to remove indexes on tables?
a) DROP INDEX
b) DELETE INDEX
c) REMOVE INDEX
d) FLUSH INDEX
Explanation: MySQL provides statements to change the structure of tables. To add or remove the indexes on the existing database tables, the ‘CREATE INDEX’ and ‘DROP INDEX’ tables are used.
8. In PHP, how is the first element accessed if $a represents an array with numeric indices?
Explanation: If $a represents an array with numeric indices, its elements are accessed as $x, $x, and so on. In general terms, each element at the position i is accessed and used as $a[i – 1].
9. Arrays can have associative indices in PHP.
Explanation: The PHP arrays can even have both numeric and associative elements. For example, $x and $x[“large”] can both be the elements of the same array. $x can be an object, whose elements are accessed by the arrow ‘->>’ operated.
10. Which operator is used to access property of an object in PHP?
Explanation: If $a represents an object, the properties it has can be accessed as $a->property-name. For instance, $a->>white, $a->black, $a->blue, $a->red can be the properties of $a and accessed in this way.
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.