inventory
Documentation | Sakila |
Name | inventory |
Module | Inventory |
The inventory table contains one row for each copy of a given film in a given store.
The inventory table refers to the film and store tables using foreign keys and is referred to by the rental table.
Columns
Key | Name | Data type | Null | Attributes | References | Description | ||
---|---|---|---|---|---|---|---|---|
1 | inventory_id | unsigned mediumint(7, 0) | Identity / Auto increment column | A surrogate primary key used to uniquely identify each item in inventory. | ||||
A surrogate primary key used to uniquely identify each item in inventory. Identity / Auto increment column |
||||||||
2 | film_id | unsigned smallint(5, 0) | film | A foreign key pointing to the film this item represents. | ||||
A foreign key pointing to the film this item represents. References: film |
||||||||
3 | store_id | unsigned tinyint(3, 0) | store | A foreign key pointing to the store stocking this item. | ||||
A foreign key pointing to the store stocking this item. References: store |
||||||||
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 | |
---|---|---|---|---|
inventory | film | inventory.film_id = film.film_id | fk_inventory_film Foreign key constraint referencing film.film_id |
|
inventory.film_id = film.film_id Name: fk_inventory_filmForeign key constraint referencing film.film_id |
||||
inventory | store | inventory.store_id = store.store_id | fk_inventory_store Foreign key constraint referencing store.store_id |
|
inventory.store_id = store.store_id Name: fk_inventory_storeForeign key constraint referencing store.store_id |
||||
film_text | inventory | film_text.film_id = inventory.film_id | fk_film_text Foreign key constraint referencing inventory.film_id |
|
film_text.film_id = inventory.film_id Name: fk_film_textForeign key constraint referencing inventory.film_id |
||||
rental | inventory | rental.inventory_id = inventory.inventory_id | fk_rental_inventory Foreign key constraint referencing inventory.inventory_id |
|
rental.inventory_id = inventory.inventory_id Name: fk_rental_inventoryForeign key constraint referencing inventory.inventory_id |
Unique keys
Key name | Columns | Description | |
---|---|---|---|
PRIMARY | inventory_id | Primary key. | |
Primary key. |
Exported: 2018-10-12 17:43, Last imported: 2018-08-06 10:44