MySQL Database Multiple Choice Questions on “Using Full Text Searches”.
1. In which mode of search is the search string parsed into words and the search looks for rows?
a) Natural language
b) Boolean mode
c) Query expansion
d) Cross mode
Answer: a
Clarification: In MySQL, a full text search capability is provided, which enables to look for words or phrases without using pattern-matching operations. There are three kinds of full text searches.
2. The indicator of presence or absence of a word in search is used in which mode?
a) Natural language
b) Boolean mode
c) Query expansion
d) Cross mode
Answer: b
Clarification: A full text search capability is provided in MySQL. It facilitates to look for words or phrases without using pattern-matching operations. Boolean search is one of the three modes.
3. Which search mode uses natural language search as a subroutine?
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.
4. FULLTEXT indexes can be created only 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.
5. A FULLTEXT index cannot be created for multiple columns.
a) True
b) False
Answer: b
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.
6. Which keyword is used to search through natural language fulltext?
a) MATCH
b) AGAINST
c) SEARCH
d) FIND
Answer: a
Clarification: In MySQL, fulltext searches are carried in three modes. Natural language fulltext search is carried out using the MATCH and AGAINST clause. MATCH keyword specifies the column to be searched.
7. What is xyz in the following MySQL statement?
SELECT * FROM my_table WHERE MATCH(abc) AGAINST('xyz');
a) column name
b) table name
c) search string
d) database name
Answer: c
Clarification: The natural language fulltext search in MySQL tables is carried out using the MATCH and AGAINST clause. The MATCH clause is used to specify the column and AGAINST specifies the search string.
8. What is abc in the following MySQL statement?
SELECT * FROM my_table WHERE MATCH(abc) AGAINST('xyz');
a) column name
b) table name
c) search string
d) database name
Answer: a
Clarification: The MATCH clause is used to specify the column and AGAINST specifies the search string in the natural language full text search syntax. It is one of the three modes of full-text search.
9. In Boolean search, results are sorted by relevance.
a) True
b) False
Answer: b
Clarification: Boolean mode FULLTEXT search is one of the three modes of FULLTEXT searches in MySQL. Boolean searches deal with the presence or absence of a word in a particular row to carry out the searches.
10. Which parameter determines the shortest words to index in FULLTEXT indexes?
a) ft_min_word_len
b) ft_min_len_word
c) ft_word_min_len
d) ft_word_len_word
Answer: a
Clarification: There are many full-text parameters that are configurable. They can be modified by setting the system variables accordingly. The ‘ft_min_word_len’ parameter determines the shortest words to index in FULLTEXT indexes.
