MySQL Questions and Answers – Loading Data Efficiently

This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Loading Data Efficiently”.

1. Bulk loading is less efficient than single row loading.
a) True
b) False
View Answer

Answer: b
Explanation: In MySQL, bulk loading is more efficient than the single row loading. The key cache does not need to be flushed after each input record is loaded. It can also be flushed at the end of the batch of records.

2. Loading is faster when a table has no indexes than when it is indexed.
a) True
b) False
View Answer

Answer: a
Explanation: Loading is faster when a table has no indexes. If there are indexes, the contents of the row should be added to the table and each index must also be modified to notify the addition of the new row.

3. Which is more efficient?

LOAD DATA, INSERT
advertisement
advertisement

a) LOAD DATA
b) INSERT
c) Same
d) Indeterminate
View Answer

Answer: a
Explanation: In MySQL, the ‘LOAD DATA’ in all forms is more efficient than the ‘INSERT’ because it loads rows in bulk. The server first parses then interprets only one statement instead of many.

4. Without LOCAL, LOAD DATA is _________________
a) more efficient
b) less efficient
c) same speed
d) arbitrary
View Answer

Answer: a
Explanation: LOAD DATA is more efficient without LOCAL. Without LOCAL, the file must be located on the server. The FILE privilege must be given. The server can read the file directly from disk.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

5. Which option turns on the –extended-insert?
a) –opt
b) –opti
c) –op
d) –optimize
View Answer

Answer: a
Explanation: If the –opt option is enabled it turns on the –extended-insert option, which produces multiple row INSERT statements and some other options that allow the dump file to be processed more efficiently.

6. Which table option for MyISAM tables reduces index flushing?
a) DELAY_KEY_WRITE
b) DELAY_WRITE_KEY
c) KEY_WRITE_DELAY
d) WRITE_KEY_DELAY
View Answer

Answer: a
Explanation: For MyISAM tables a strategy for reducing index flushing is to use the DELAY_KEY_WRITE table option. With this option the data rows are written to the data file immediately.
advertisement

7. Which option repairs MyISAM tables automatically after they open?
a) –myisam-recover=FORCE
b) –myisam-recover=STOP
c) –recover-myisam=FORCE
d) –recover-myisam=STOP
View Answer

Answer: a
Explanation: In order to make sure that the repairs happen the server is started with the –myisam-recover=FORCE option. This enables the server to check MyISAM tables when it opens them and repair them automatically.

8. The option which delays index flushing for slave server is _________________
a) –delay-write-key=ALL
b) –delay-key-write=ALL
c) –key-write-delay=NONE
d) –key-delay-write=NONE
View Answer

Answer: b
Explanation: For the replication slave servers, the –delay-key-write=ALL option delays index flushing for all MyISAM tables, regardless of how they were created originally on the master server.
advertisement

9. TO enable the compressed client/server protocol the option is _________________
a) –enable
b) –compress
c) –reduce
d) –restrict
View Answer

Answer: b
Explanation: The compressed client/server protocol is used to reduce the amount of data going over the network. For most of the MySQL clients this is specified using the –compress command line option.

10. To reactivate indexes the command used is _________________
a) DISABLE KEYS
b) DISABLE INDEXES
c) ENABLE KEYS
d) ENABLE INDEXES
View Answer

Answer: c
Explanation: In MySQL, the clauses ‘DISABLE KEYS’ and ‘ENABLE KEYS’ are used to deactivate and reactivate indexes for the table. The server does the work in deactivations and reactivations.

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.