This quiz will test your understanding of wildcards and regular expressions in MySQL. You’ll encounter questions on the LIKE and REGEXP operators, how to use wildcards like % and _ for flexible searches, and how regular expressions enable advanced pattern matching. These techniques are essential for searching and manipulating text data efficiently in MySQL.
1.
Which regular expression pattern ensures that a word appears as a separate word in a string?
2.
Which wildcard should be used in a LIKE statement to find names that contain 'Air' anywhere in the string?
3.
What does [[:digit:]]{3} match in a MySQL regular expression?
4.
What does [[:alnum:]] match in a MySQL regular expression?
5.
What does the wildcard character % represent in a MySQL LIKE query?
6.
Which MySQL function is used to search for a pattern in a string using regular expressions?
7.
Which SQL clause is used in MySQL for wildcard pattern matching?
8.
What does the . (dot) symbol represent in a MySQL regular expression?
9.
Which MySQL function is used to replace occurrences of a pattern using regular expressions?
10.
Which wildcard should be used to find a name that starts with 'Book'?
11.
What will the following query return?
SELECT name FROM product WHERE name LIKE 'Mac%';
12.
Which regular expression pattern ensures that a word appears at the beginning of a string?
13.
Which SQL statement would retrieve all rows where the product name ends with 'Pro'?
14.
Which regular expression pattern would match a product name that contains 'USB' followed by either 'A' or 'C'?
15.
Which operator is used for regular expression matching in MySQL?
16.
Which wildcard character matches exactly one character in a LIKE query?