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
a) 0
b) 1
c) 2
d) 3
View Answer
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
a) 0
b) 1
c) 2
d) 3
View Answer
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?
a) key_buffer_size
b) read_buffer_size
c) sort_buffer_size
d) write_buffer_size
View Answer
Explanation: The myisamchk variable ‘key_buffer_size’ stores the size of buffer that is used to hold index blocks. ‘read_buffer_size’ stores the 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?
a) –next-storage-engine
b) –new-storage-engine
c) –clear-storage-engine
d) –get-storage-engine
View Answer
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. With only MyISAM tables, how many of the following are for use?
mysql, mysqladmin, mysqldump, mysqlisamchk
a) 1
b) 2
c) 3
d) 4
View Answer
Explanation: ‘mysqlcheck’ and ‘mysqlisamchk’ are the programs that perform table checking, analysis, optimization and repairs when tables become damaged. ‘mysqlcheck’ works with MyISAM tables.
6. The place where the server stores its databases and status files are the database directory.
a) True
b) False
View Answer
Explanation: The MySQL data directory is the place where the server stores its databases and status files. It is crucial to understand all structures and contents of the data directory.
7. What is the output from PHP?
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.
8. What are PHP variables preceded by?
a) _
b) @
c) $
d) &
View Answer
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.
9. Which data type is best suited to store currency values?
a) INT
b) FLOAT
c) DOUBLE
d) DECIMAL
View Answer
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.
- Check MySQL Books
- Practice Programming MCQs
- Apply for Programming Internship
- Check Information Technology Books