Back to subject
MySQL/Databases

See What's Already There

Practical lesson

Before building anything, it's worth getting comfortable simply looking around a server.

SHOW DATABASES; lists every database that currently exists, including a few MySQL creates automatically for its own internal use (information_schema, mysql, performance_schema, and sys are standard system databases you'll usually leave alone).

In the example output, school is a database someone created for real project data, sitting alongside those system databases.

If you wanted to start working inside school, the next command would be USE school; after that, any SELECT or table command you type applies inside it by default, without you needing to repeat the database name every time.

This two-step habit SHOW DATABASES; to see what exists, then USE the one you need is something you'll do at the start of almost every real session.

Try it yourself
Code

Starter example

Code
SHOW DATABASES;
Live preview
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql               |
| performance_schema |
| school              |
+--------------------+
4 rows in set