MySQL Database Multiple Choice Questions on “Tuning the Server”.
1. Which mode exists at both global level and session-specific level?
a) sql_mode
b) key_buffer_size
c) server_mode
d) query_mode
Answer: a
Clarification: The system variable ‘sql_mode’ that indicates the default SQL mode is an example of a variable that exists at both the global and session levels. This mode affects several aspects of SQL statement processing.
2. Which system variable determines the number of rows from INSERT DELAYED statements that can be queued per table?
a) fast_queue_size
b) general_queue_size
c) slow_queue_size
d) delayed_queue_size
Answer: d
Clarification: The system variable ‘delayed_queue_size’ determines the number of rows from INSERT DELAYED statements that can be queued per table (for the storage engines that support DELAYED inserts).
3. The largest value to which the variable ‘max_allowed_packet’ can be set is ______________
a) 1GB
b) 2GB
c) 4GB
d) 8GB
Answer: a
Clarification: The ‘max_allowed_packet’ stores the maximum size to which the buffer used for client communications can grow. The largest value to which ‘max_allowed_packet’ variable can be set is 1GB.
4. Increasing the value of which system variable enables mysqld to keep more tables open simultaneously?
a) table_cache
b) max_connect
c) delayed_queue_size
d) max_allowed_packet
Answer: a
Clarification: The ‘table_cache’ stores the size of the table cache. Increasing the value enables ‘mysqld’ to keep more tables open simultaneously by reducing the number of files open and close operations.
5. The keyword used with UNION that retains duplicate rows is ___________
a) ALL
b) NARROW
c) STRICT
d) DISTINCT
Answer: a
Clarification: The keyword ‘ALL’ used along with ‘UNION’ is not synonymous with just the ‘UNION’ statement. It produces the duplicate rows, if they exist, from the combination of the two tables in the SELECT query.
6. The search mode that uses natural language search as a subroutine is ____________
a) Natural language
b) Boolean mode
c) Query expansion
d) Cross mode
Answer: c
Clarification: The query expansion search occurs in two phases. The natural language search is applied in the first phase. Query expansion search is one of the three modes of fulltext searching.
7. For what can the FULLTEXT indexes be created for?
a) MyISAM
b) InnoDB
c) MEMORY
d) TRANSITION
Answer: a
Clarification: Full-text searches are based on the FULLTEXT indexes. They can be created for MyISAM tables only. In MySQL, a full text search enables to look for words or phrases without using pattern-matching operations.
8. A FULLTEXT index can be created for multiple columns.
a) True
b) False
Answer: a
Clarification: In MySQL, a full-text search is based on the FULLTEXT indexes. A FULLTEXT index can be created both for a single column and for multiple columns. Searching is possible across columns.
