This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Checking and Repairing Database Tables”.
1. CHECK TABLE works with how many of the following?
MyISAM, ARCHIVE, CSV
Explanation: The ‘CHECK TABLE’ statement provides an interface to the table checking capabilities of the server. It works for MyISAM and InnoDB tables as well as for ARCHIVE and CSV tables.
2. REPAIR TABLE works with how many of the following?
MyISAM, ARCHIVE, CSV
Explanation: The ‘REPAIR TABLE’ statement provides an interface to the table repair capabilities of the server. It works with MyISAM and ARCHIVE tables. It also works with CSV tables as of MySQL 5.1.19.
3. Which myisamchk variable represents the size of buffer used to hold index blocks?
Explanation: The myisamchk variable ‘key_buffer_size’ stores the size of buffer that is used to hold index blocks. ‘read_buffer_size’ stores size of buffer used for read operations, ‘sort_buffer_size’ is used for sorting.
4. Which option is used in ‘mysqldump’ to make all tables in the destination databases to use a different storage engine?
Explanation: While using the program ‘mysqldump’ in MySQL to copy databases from server to server, all tables in the destination databases can be directed to use a different storage engine with the –new-storage-engine option.
5. What is the hub of a MySQL installation?
Explanation: The server, mysqld , is the hub of a MySQL installation; it performs all manipulation of databases and tables. On Unix, several related scripts are available to assist in server startup.
6. With only MyISAM tables, how many of the following are for use?
mysql, mysqladmin, mysqldump, mysqlisamchk
Explanation: ‘mysqlcheck’ and ‘mysqlisamchk’ are the programs that perform table checking, analysis, optimization and repairs when tables become damaged. ‘mysqlcheck’ works with MyISAM tables.
7. The place where the server stores its databases and status files is the database directory.
Explanation: The MySQL data directory is the place where the server stores its databases and status files. It is crucial to understand the all structures and contents of the data directory.
8. What is the output from PHP?
a) statically generated
b) dynamically generated
c) not generated
d) no output
Explanation: The interpreter switches between code mode back and text mode when it sees another special tag which signals the end of the code. This enables the mix of static text with dynamically generated results.
9. What are PHP variables preceded by?
Explanation: All the PHP scripts that use variables have variable names preceded by the dollar sign (‘$’). The variables are signified by this identifier, irrespective of the value it stores.
10. Which data type is best suited to store currency values?
Explanation: Currency is a numeric information. For monetary calculations, FLOAT and DOUBLE are subject to rounding error and may not be suitable. A DECIMAL(M, 2) type is best suited for it.
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.