Querying Full-Text Data in Microsoft SQL Server 2012
- 12/15/2012
Answers
This section contains answers to the lesson review questions and solutions to the case scenarios in this chapter.
Lesson 1
Correct Answers: A and D
Correct: Stopwords include noisy words.
Incorrect: Thesaurus is used for synonyms.
Incorrect: Stemmer is used for generating inflectional forms of words.
Correct: You group stopwords in stoplists.
Correct Answer: C
Incorrect: The msdb database is installed by default and is used for SQL Server Agent.
Incorrect: The distribution database is installed and used by replication.
Correct: You need the semanticsdb database in order to enable semantic search.
Incorrect: The tempdb database is installed by default and is used for all temporary objects.
Correct Answer: A
Correct: You can add synonyms by editing the thesaurus file.
Incorrect: Full-text search uses thesaurus files and not tables for synonyms.
Incorrect: You cannot use stopwords for synonyms.
Incorrect: Full-text search supports synonyms.
Lesson 2
Correct Answer: E
Incorrect: FORMSOF is a valid keyword of the CONTAINS predicate.
Incorrect: THESAURUS is a valid keyword.
Incorrect: NEAR is a valid keyword.
Incorrect: PROPERTY is a valid keyword.
Correct: TEMPORARY is not a valid keyword of the CONTAINS predicate.
Correct Answer: A
Correct: This proximity term defines both distance and order of searched terms.
Incorrect: This is not a valid syntax.
Incorrect: This proximity term defines distance of searched terms only.
Incorrect: This proximity term does not define either distance or order of searched terms.
Correct Answers: A, B, D, and E
Correct: You can search for inflectional forms of a word.
Correct: You can search for synonyms of a searched word.
Incorrect: Full-text search does not support translations.
Correct: You can search for text in which a search word is close to another search word.
Correct: You can search for a prefix of a word or a phrase only.
Lesson 3
Correct Answer: A
Correct: You use the CONTAINSTABLE function to rank documents based on proximity of words.
Incorrect: You use the FREETEXTTABLE function to rank documents based on containment of words.
Incorrect: You use the SEMANTICKEYPHRASETABLE function to return key phrases associated with the full-text indexed column.
Incorrect: You use the SEMANTICSIMILARITYTABLE function to retrieve documents scored by similarity to a specified document.
Incorrect: You use the SEMANTICSIMILARITYDETAILSTABLE function to return key phrases that are common across two documents.
Correct Answer: D
Incorrect: You use the CONTAINSTABLE function to rank documents based on proximity of words.
Incorrect: You use the FREETEXTTABLE function to rank documents based on containment of words.
Incorrect: You use the SEMANTICKEYPHRASETABLE function to return key phrases associated with the full-text indexed column.
Correct: You use the SEMANTICSIMILARITYTABLE function to retrieve documents scored by similarity to a specified document.
Incorrect: You use the SEMANTICSIMILARITYDETAILSTABLE function to return key phrases that are common across two documents.
Correct Answer: C
Incorrect: You use the CONTAINSTABLE function to rank documents based on proximity of words.
Incorrect: You use the FREETEXTTABLE function to rank documents based on containment of words.
Correct: You use the SEMANTICKEYPHRASETABLE function to return key phrases associated with the full-text indexed column.
Incorrect: You use the SEMANTICSIMILARITYTABLE function to retrieve documents scored by similarity to a specified document.
Incorrect: You use the SEMANTICSIMILARITYDETAILSTABLE function to return key phrases that are common across two documents.
Case Scenario 1
You should use the Full-Text Search feature of SQL Server.
You should revise your queries to include the full-text predicates, or use the full-text and semantic search table-valued functions.
Case Scenario 2
A T-SQL solution is simpler in this scenario because the SQL Server Full-Text Search and Semantic Search features support the functionality you need out of the box.
You should use the SEMANTICSIMILARITYTABLE function.