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.
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.
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
a) LOAD DATA
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
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.
5. Which option turns on the –extended-insert?
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?
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.
7. Which option repairs MyISAM tables automatically after they open?
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 _________________
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.
9. TO enable the compressed client/server protocol the option is _________________
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
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.