Complete the code to create a full-text index on the 'content' column of the 'articles' table.
CREATE FULLTEXT INDEX [1] ON articles(content);The index name can be any valid identifier. Here, idx_content is a common naming style for indexes.
Complete the query to search for the word 'database' using full-text search on the 'content' column in the 'articles' table.
SELECT * FROM articles WHERE MATCH(content) AGAINST('[1]');
The simplest full-text search uses the word directly inside single quotes. Here, 'database' searches for the word.
Fix the error in the full-text search query to find rows containing the word 'mysql' in the 'description' column of 'products'.
SELECT * FROM products WHERE MATCH(description) AGAINST([1] IN NATURAL LANGUAGE MODE);The search term must be a string literal enclosed in single quotes. Without quotes, it causes a syntax error.
Fill both blanks to create a full-text index on columns 'title' and 'body' in the 'posts' table.
CREATE FULLTEXT INDEX [1] ON posts([2]);
The index name is idx_title_body. Multiple columns are listed separated by commas: title, body.
Fill all three blanks to write a full-text search query that finds rows in 'documents' where 'text' matches the phrase 'open source' using boolean mode.
SELECT * FROM documents WHERE MATCH([1]) AGAINST([2] IN [3]);
The column is text. The search phrase must be quoted as '"open source"' to search exact phrase. The mode is BOOLEAN MODE to allow phrase search.