MySQL Questions and Answers – Performing Database Maintenance with the Server Running

This set of MySQL Multiple Choice Questions & Answers focuses on “Performing Database Maintenance with the Server Running”.

1. To perform consistency checks on a MyISAM table the statement is _____________
a) CHECK TABLE
b) REPAIR TABLE
c) ANALYZE TABLE
d) OPTIMIZE TABLE
View Answer

Answer: a
Explanation: In order to perform consistency checks or table repairs on a MyISAM table a ‘CHECK TABLE’ or ‘REPAIR TABLE’ statement is issued. The ‘mysqlcheck’ program can also be invoked.

2. The statement that performs key distribution analysis and stores the distribution for the named tables is _____________
a) CHECK TABLE
b) ANALYZE TABLE
c) CHECKSUM TABLE
d) OPTIMIZE TABLE
View Answer

Answer: b
Explanation: ‘ANALYZE TABLE’ performs a key distribution analysis and stores the distribution for the named table or tables. For the MyISAM tables, this statement is equivalent to using ‘myisamchk –analyze’.

3. The column not returned by ‘OPTIMIZE TABLE’ is _____________
a) Table
b) Msg_txt
c) Op
d) Msg_type
View Answer

Answer: b
Explanation: ‘OPTIMIZE TABLE’ table catches and throws any errors that occur while copying table statistics from the old file to the newly created file. It returns a result set of columns.
advertisement
advertisement

4. For which table does ‘REPAIR TABLE’ not work?
a) MyISAM
b) ARCHIVE
c) CSV
d) InnoDB
View Answer

Answer: d
Explanation: ‘REPAIR TABLE’ works for MyISAM, ARCHIVE, and CSV tables. For MyISAM tables, it has the same effect as ‘myisamchk –recover’ tbl_name by default. This statement does not work with views.

5. What is the Perl DBI?
a) database inheritance
b) database integrity
c) database interface
d) database isolation
View Answer

Answer: c
Explanation: The Perl DBI is the Perl Database Interface. The work of the interface is to form a link between the application programming interface in C with all the other programming languages.

6. What is the default path to Perl in Unix?
a) /usr/bin/perl
b) /usr/bin
c) /usr/perl
d) /usr/perl/bin
View Answer

Answer: a
Explanation: All Perl scripts generally begin with a #! (shebang) line. A script is a file containing a sequence of commands. The Perl scripts are text files, which can be created using any text editor.

7. How is the output from PHP generated?
a) statically generated
b) dynamically generated
c) not generated
d) no output
View Answer

Answer: b
Explanation: The interpreter switches between code mode back and text mode when it sees another special tag that signals the end of the code. This enables the mix of static text with dynamically generated results.
advertisement

Sanfoundry Global Education & Learning Series – MySQL Database.

To practice all areas of MySQL, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

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.