Complete the code to create a text search query for the term 'cat'.
SELECT to_tsquery([1]);The to_tsquery function requires the search term as a string literal, so it must be enclosed in single quotes.
Complete the code to create a text search query for the phrase 'cat & dog'.
SELECT to_tsquery([1]);The & operator in to_tsquery means AND, so the phrase must be written as 'cat & dog' inside single quotes.
Fix the error in the code to correctly create a text search query for 'cat | dog'.
SELECT to_tsquery([1]);| operator.The OR operator in to_tsquery is |, and the entire query must be a string literal in single quotes.
Fill both blanks to create a text search query that searches for 'cat' AND 'dog' but NOT 'mouse'.
SELECT to_tsquery([1]); -- 'cat & dog [2] mouse'
The AND operator is & and NOT is !. To combine them, use &! to mean AND NOT. The query string should be 'cat & dog &! mouse'.
Fill all three blanks to create a text search query that searches for 'cat' OR 'dog' AND excludes 'mouse'.
SELECT to_tsquery([1]); -- 'cat [2] dog [3] mouse'
The OR operator is | and to exclude a term, use NOT !. To combine OR and NOT, use |!. The query string is 'cat | dog |! mouse'.