Multiple choice technology databases

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

  1. SHOW DATABASES LIKE ‘%tech%’;

  2. SHOW DATABASES LIKE ‘%tech;

  3. SHOW DATABASES LIKE ‘'tech'%’;

  4. SHOW DATABASES LIKE ‘tech%’;

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

SHOW DATABASES LIKE 'tech%' correctly returns all databases whose names start with 'tech'. The % wildcard matches zero or more characters, so 'tech%' finds 'tech', 'technology', 'tech1', etc. Options A and C have the % in the wrong position (matches names containing 'tech'), and B has a syntax error with an unclosed quote.