1. Home
  2. Computer Science MCQs
  3. MySQL
  4. How do I find out all databases, starting with `test to…

Added 19 Jan 2024

How do I find out all databases, starting with `test to which I have access to?

  1. SHOW DATABASES LIKE `%test%`; Correct answer
  2. SHOW DATABASES LIKE `%test;
  3. SHOW DATABASES LIKE `’test’%’;
  4. SHOW DATABASES LIKE `%test%’;

Correct answer

A. SHOW DATABASES LIKE `%test%`;

20 views

MCQSEXAM

Explanation

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.

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More MySQL MCQs

Practise all MySQL MCQs

Similar MCQs