city
Documentation | Sakila |
Name | city |
Module | Customer Data |
The city table contains a list of cities.
The city table is referred to by a foreign key in the address table and refers to the country table using a foreign key.
Columns
Key | Name | Data type | Null | Attributes | References | Description | ||
---|---|---|---|---|---|---|---|---|
1 | city_id | unsigned smallint(5, 0) | Identity / Auto increment column | A surrogate primary key used to uniquely identify each city in the table. | ||||
A surrogate primary key used to uniquely identify each city in the table. Identity / Auto increment column |
||||||||
2 | city | varchar(50) | Name of the city. | |||||
Name of the city. |
||||||||
3 | country_id | unsigned smallint(5, 0) | country | A foreign key identifying the country that the city belongs to. | ||||
A foreign key identifying the country that the city belongs to. References: country |
||||||||
4 | last_update | timestamp | Default: CURRENT_TIMESTAMP | The time that the row was created or most recently updated. | ||||
The time that the row was created or most recently updated. Default: CURRENT_TIMESTAMP |
Relations
Foreign table | Primary table | Join | Title / Name / Description | |
---|---|---|---|---|
city | country | city.country_id = country.country_id | fk_city_country Foreign key constraint referencing country.country_id |
|
city.country_id = country.country_id Name: fk_city_countryForeign key constraint referencing country.country_id |
||||
address | city | address.city_id = city.city_id | fk_address_city Foreign key constraint referencing city.city_id |
|
address.city_id = city.city_id Name: fk_address_cityForeign key constraint referencing city.city_id |
Unique keys
Key name | Columns | Description | |
---|---|---|---|
PRIMARY | city_id | Primary key. | |
Primary key. |
Uses
Name |
---|
city
|
Used by
Name |
---|
city
|
Exported: 2018-10-12 17:43, Last imported: 2018-08-06 10:44