MySQL Questions and Answers – Checking and Repairing Database Tables

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

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

a) 0
b) 1
c) 2
d) 3
View Answer

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

Answer: a
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.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

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

a) 1
b) 2
c) 3
d) 4
View Answer

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

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

7. What is the output from PHP?
a) statically generated
b) dynamically generated
c) not generated
d) no output
View Answer

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

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

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

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.