address
Documentation | Sakila |
Name | address |
Module | Customer Data |
Columns
Key | Name | Data type | Null | Attributes | References | Description | ||
---|---|---|---|---|---|---|---|---|
1 | address_id | unsigned smallint(5, 0) | Identity / Auto increment column | A surrogate primary key used to uniquely identify each address in the table. | ||||
A surrogate primary key used to uniquely identify each address in the table. Identity / Auto increment column |
||||||||
2 | address | varchar(50) | The first line of an address. | |||||
The first line of an address. |
||||||||
3 | address2 | varchar(50) | An optional second line of an address. | |||||
An optional second line of an address. |
||||||||
4 | district | varchar(20) | The region of an address, this may be a state, province, prefecture, etc. | |||||
The region of an address, this may be a state, province, prefecture, etc. |
||||||||
5 | city_id | unsigned smallint(5, 0) | city | A foreign key pointing to the city table. | ||||
A foreign key pointing to the city table. References: city |
||||||||
6 | postal_code | varchar(10) | The postal code or ZIP code of the address (where applicable). | |||||
The postal code or ZIP code of the address (where applicable). |
||||||||
7 | phone | varchar(20) | The telephone number for the address. | |||||
The telephone number for the address. |
||||||||
8 | location | geometry | A Geometry column with a spatial index on it. (The spatial location column is supported as of MySQL 5.7.5. This column is only added when executing the sakila SQL files against MySQL server 5.7.5 and above. Additionally, "SPATIAL KEY idx_location" is also added.) | |||||
A Geometry column with a spatial index on it. (The spatial location column is supported as of MySQL 5.7.5. This column is only added when executing the sakila SQL files against MySQL server 5.7.5 and above. Additionally, "SPATIAL KEY idx_location" is also added.) |
||||||||
9 | 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 | |
---|---|---|---|---|
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 |
||||
customer | address | customer.address_id = address.address_id | fk_customer_address Foreign key constraint referencing address.address_id |
|
customer.address_id = address.address_id Name: fk_customer_addressForeign key constraint referencing address.address_id |
||||
staff | address | staff.address_id = address.address_id | fk_staff_address Foreign key constraint referencing address.address_id |
|
staff.address_id = address.address_id Name: fk_staff_addressForeign key constraint referencing address.address_id |
||||
store | address | store.address_id = address.address_id | fk_store_address Foreign key constraint referencing address.address_id |
|
store.address_id = address.address_id Name: fk_store_addressForeign key constraint referencing address.address_id |
Unique keys
Key name | Columns | Description | |
---|---|---|---|
PRIMARY | address_id | Primary key. | |
Primary key. |
Uses
Name |
---|
address
|
Exported: 2018-10-12 17:43, Last imported: 2018-08-06 10:44