# Databases vs Tables — MySQL Fundamentals: SQL, Joins and Transactions

Source: https://www.skillbyai.com/en/mysql/sql-databases-tables

> Create databases, switch between them with USE and see how one server hosts many databases of tables.

## Creating & selecting a database

A **database** is a named container for tables. `USE` switches your active database.

```sql
CREATE DATABASE shop;
USE shop;
SHOW TABLES;
```

Output:

```
Empty set (0.00 sec)
```

## One server, many databases

A single MySQL server commonly hosts several databases — one per application — each isolated with its own set of tables.

**Quiz:** What does `USE shop;` do?

- [ ] Creates a new database
- [ ] Deletes the `shop` database
- [x] Makes `shop` the active database for following queries
- [ ] Lists every table in the server

*Answer:* Makes `shop` the active database for following queries. `USE` just switches context — no data is created or removed.
