Google Cloud Professional Cloud Database Engineer — Question 157
You have a Cloud SQL for MySQL instance with a table of product information including a column of product descriptions. Your application development team is building a customer facing chatbot and would like to find the product that most closely matches a freeform text description provided by the customer. How should you enable this functionality?
Answer options
- A. Create a stored procedure that uses a regular expression to match the customer’s search text to values in the product description column.
- B. Create and populate a column of product description embeddings on the product table and perform an approximate nearest neighbor search using the customer’s search text.
- C. Use the LIKE operator to match the customer’s search text to the product description and return similar rows.
- D. Create a SQL script that compares the product description and the customer’s search text by using the SOUNDEX function.
Correct answer: B
Explanation
The correct answer is B because creating a column of product description embeddings allows for more advanced matching techniques, such as approximate nearest neighbor searches, which are better suited for freeform text comparison. In contrast, the other options (A, C, and D) rely on simpler methods that may not effectively capture the nuances of customer descriptions compared to embedding techniques.