In this exercise you will practice
You work for the housing department of a major university and want to analyze information in your residency database.
If on macOS, make sure your MySQL server is running:
$ mysql.server start
Starting MySQL
SUCCESS!
Run the ~dorms.sql~ script like this (can leave off -p if your password is blank):
$ mysql -u root -p < dorms-schema.sql
$ mysql -u root -p < dorms-data.sql
Start MySQL’s client and ~use~ the ~dorms~ database.
```sh
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
...
mysql> use dorms
...
Database changed
mysql>
```
Get a list of the tables:
mysql> show tables;
+-----------------+
| Tables_in_dorms |
+-----------------+
| dorm |
| student |
+-----------------+
2 rows in set (0.00 sec)
See the structure of a table:
mysql> describe dorm;
+---------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+---------+------+-----+---------+-------+
| dorm_id | int(11) | NO | PRI | NULL | |
| name | text | YES | | NULL | |
| spaces | int(11) | YES | | NULL | |
+---------+---------+------+-----+---------+-------+
3 rows in set (0.00 sec)