# Sample Database: Universe
__*DESC*__
+ View table schema: `DESC <schema_name>.<table_name>`

![right](./student-guide/diagram/schema-universe.drawio.png)
```9
tidb> SHOW TABLES FROM universe;
+--------------------+
| Tables_in_universe |
+--------------------+
| moons              |
| planet_categories  |
| planets            |
| stars              |
+--------------------+
4 rows in set (0.00 sec)

DESC universe.stars;
DESC universe.planet_categories;
DESC universe.planets;
DESC universe.moons;
```

------------------------------------------------------------

You should have completed the two exercises in 201.1, and in the second exercise, the script universe.sql creates a database/schema called universe for us that contains 4 tables.

In this course, we often use the full names of tables in order to reference them, such as "<schema_name>.<table_name>". You can also use the USE command to first select the schema so that you can use the simple form of the table name directly in subsequent operations, such as:

```
tidb> USE universe;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
tidb> SHOW TABLES;
+--------------------+
| Tables_in_universe |
+--------------------+
| moons              |
| planet_categories  |
| planets            |
| stars              |
+--------------------+
4 rows in set (0.00 sec)
```

```
tidb> DESC universe.stars;
+----------------------+--------------+------+------+---------+-------+
| Field                | Type         | Null | Key  | Default | Extra |
+----------------------+--------------+------+------+---------+-------+
| id                   | bigint(20)   | NO   | PRI  | NULL    |       |
| name                 | char(20)     | NO   | MUL  |         |       |
| mass                 | float        | NO   |      | 0.0     |       |
| density              | int(11)      | NO   |      | 0       |       |
| gravity              | decimal(8,1) | NO   |      | 0.0     |       |
| escape_velocity      | decimal(8,1) | NO   |      | 0.0     |       |
| mass_conversion_rate | int(11)      | NO   |      | 0       |       |
| spectral_type        | char(8)      | NO   |      |         |       |
+----------------------+--------------+------+------+---------+-------+
8 rows in set (0.00 sec)

tidb> DESC universe.planet_categories;
+-------+----------+------+------+---------+----------------+
| Field | Type     | Null | Key  | Default | Extra          |
+-------+----------+------+------+---------+----------------+
| id    | int(11)  | NO   | PRI  | NULL    | auto_increment |
| name  | char(20) | NO   | MUL  | NULL    |                |
+-------+----------+------+------+---------+----------------+
2 rows in set (0.00 sec)

tidb> DESC universe.planets;
+-----------------------+---------------+------+------+---------+-------+
| Field                 | Type          | Null | Key  | Default | Extra |
+-----------------------+---------------+------+------+---------+-------+
| id                    | bigint(20)    | NO   | PRI  | NULL    |       |
| name                  | char(20)      | NO   | MUL  |         |       |
| mass                  | float         | NO   |      | 0.0     |       |
| diameter              | decimal(12,2) | NO   |      | 0       |       |
| density               | int(11)       | NO   |      | 0       |       |
| gravity               | decimal(8,1)  | NO   |      | 0.0     |       |
| escape_velocity       | decimal(8,1)  | NO   |      | 0.0     |       |
| rotation_period       | decimal(5,1)  | NO   |      | 0.0     |       |
| length_of_day         | decimal(8,1)  | NO   |      | 0.0     |       |
| distance_from_sun     | float         | NO   |      | 0.0     |       |
| perihelion            | float         | NO   |      | 0.0     |       |
| aphelion              | float         | NO   |      | 0.0     |       |
| orbital_period        | decimal(12,1) | NO   |      | 0.0     |       |
| orbital_velocity      | decimal(12,1) | NO   |      | 0.0     |       |
| orbital_inclination   | decimal(8,1)  | NO   |      | 0.0     |       |
| orbital_eccentricity  | decimal(7,0)  | NO   |      | 0.0     |       |
| obliquity_to_orbit    | decimal(10,4) | NO   |      | 0.0     |       |
| mean_temperature      | int(11)       | NO   |      | 0       |       |
| surface_pressure      | float         | YES  |      | NULL    |       |
| ring_systems          | tinyint(1)    | NO   |      | 0       |       |
| global_magnetic_field | tinyint(1)    | YES  |      | 0       |       |
| sun_id                | bigint(20)    | NO   |      | NULL    |       |
| category_id           | int(11)       | NO   |      | NULL    |       |
+-----------------------+---------------+------+------+---------+-------+
23 rows in set (0.00 sec)

tidb> DESC universe.moons;
+-----------+---------------+------+------+---------+-------+
| Field     | Type          | Null | Key  | Default | Extra |
+-----------+---------------+------+------+---------+-------+
| id        | bigint(20)    | NO   | PRI  | NULL    |       |
| name      | char(20)      | NO   | MUL  | NULL    |       |
| alias     | char(20)      | NO   | MUL  | NULL    |       |
| mass      | float         | YES  |      | NULL    |       |
| diameter  | decimal(12,2) | NO   |      | 0       |       |
| planet_id | bigint(20)    | NO   |      | NULL    |       |
+-----------+---------------+------+------+---------+-------+
6 rows in set (0.00 sec)
```

Note: If we don't use full table name in this course, the default database/schema name is "universe".
