250+ TOP MCQs on Performing Database Maintenance with the Server Running and Answers

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

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

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

Answer: b
Clarification: ‘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.

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

Answer: d
Clarification: ‘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

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

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

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

Leave a Reply

Your email address will not be published. Required fields are marked *