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?
a) MyISAM
b) InnoDB
c) Falcon
d) TRANSACTION
View Answer
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
a) 0
b) 1
c) 2
d) 3
View Answer
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?
a) –delay-write-key
b) –delay-key-write
c) –write-key-delay
d) –key-write-delay
View Answer
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?
a) –silent
b) –wild
c) –suppress
d) –noout
View Answer
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?
a) $dbh
b) $sth
c) $fh
d) $h
View Answer
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 _____________
a) $rc
b) $rv
c) $rows
d) $ary
View Answer
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. In PHP, how is the first element accessed if $a represents an array with numeric indices?
a) $a[1]
b) $a[0]
c) $a.1
d) $a.0
View Answer
Explanation: If $a represents an array with numeric indices, its elements are accessed as $x[0], $x[1], and so on. In general terms, each element at the position i is accessed and used as $a[i – 1].
8. Arrays can have associative indices in PHP.
a) True
b) False
View Answer
Explanation: The PHP arrays can even have both numeric and associative elements. For example, $x[1] 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.
9. Which operator is used to access property of an object in PHP?
a) .
b) *
c) ->
d) @
View Answer
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.
- Check Information Technology Books
- Apply for Programming Internship
- Check MySQL Books
- Practice Programming MCQs