How do I find out all databases, starting with `test to which I have access to?
Correct answer
A. SHOW DATABASES LIKE `%test%`;
20 views
A. SHOW DATABASES LIKE `%test%`;
20 views
The correct answer is A) SHOW DATABASES LIKE '%test%'; because it uses the LIKE operator with wildcards to find database names containing “test.” The percent sign (%) matches any number of characters before or after the specified text. Option B is missing the closing wildcard and quotation mark, while C uses incorrect quotation marks and wildcard placement. Option D has an incorrectly placed quotation mark, making the SQL statement invalid.
Not sure why the answer is A? Ask here and get an explanation.