MySQL Questions and Answers – General Preventative Maintenance

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

Answer: c
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

Answer: d
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.
advertisement
advertisement

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

Answer: b
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

Answer: a
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.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

5. What is the variable that is a handle to a database object?
a) $dbh
b) $sth
c) $fh
d) $h
View Answer

Answer: a
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

Answer: a
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.
advertisement

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

Answer: b
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

Answer: a
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.
advertisement

9. Which operator is used to access property of an object in PHP?
a) .
b) *
c) ->
d) @
View Answer

Answer: c
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.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.