250+ TOP MCQs on Checking and Repairing Database Tables and Answers

MySQL Database Multiple Choice Questions 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

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

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

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

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

Answer: a
Clarification: ‘mysqlcheck’ and ‘mysqlisamchk’ are the programs that perform table checking, analysis, optimization and repairs when tables become damaged. ‘mysqlcheck’ works with MyISAM tables.

  250+ TOP MCQs on Using Multiple-Statement Execution and Answers

6. The place where the server stores its databases and status files are the database directory.
a) True
b) False

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

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.

8. What are PHP variables preceded by?
a) _
b) @
c) $
d) &

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

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

Leave a Comment

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

Scroll to Top