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
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
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
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.
4. For which table does ‘REPAIR TABLE’ not work?
a) MyISAM
b) ARCHIVE
c) CSV
d) InnoDB
View Answer
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
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
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
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.
Sanfoundry Global Education & Learning Series – MySQL Database.
To practice all areas of MySQL, here is complete set of 1000+ Multiple Choice Questions and Answers.
If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]
- Apply for Programming Internship
- Check Information Technology Books
- Check MySQL Books
- Practice Programming MCQs