Show Databases — SQL Technical Interview Questions & Answers
Show Databases
Show Databases
- SHOW DATABASES; lists every database this user can see. You will also see system ones like mysql, information_schema, performance_schema, sys — don’t DROP those.
- SHOW CREATE DATABASE college; shows how it was created (charset). For tables: SHOW TABLES; after USE.
- Trap: dropping mysql or information_schema because they ‘look extra’. That breaks the server.
- On the example next to this theory: Show Databases — cREATE DATABASE makes a schema; USE selects it for following statements.
Technical Interview Tip: SHOW DATABASES; never drop mysql or information_schema.
Code Examples for Show Databases
Show Databases — sample query
-- Database admin (MySQL syntax; run on MySQL server)
-- CREATE DATABASE shop;
-- USE shop;
-- SHOW DATABASES;
SELECT 'Use CREATE/USE/SHOW on MySQL server' AS tip;Show Databases — cREATE DATABASE makes a schema; USE selects it for following statements.
How to Explain Show Databases to an Interviewer
What does SHOW DATABASES do?
Lists databases Skip system schemas when you practise