staff
Documentation | Sakila |
Name | staff |
Module | Business |
The staff table lists all staff members, including information on email address, login information, and picture.
The staff table refers to the store and address tables using foreign keys, and is referred to by the rental, payment, and store tables.
Columns
Key | Name | Data type | Null | Attributes | References | Description | ||
---|---|---|---|---|---|---|---|---|
1 | staff_id | unsigned tinyint(3, 0) | Identity / Auto increment column | A surrogate primary key that uniquely identifies the staff member. | ||||
A surrogate primary key that uniquely identifies the staff member. Identity / Auto increment column |
||||||||
2 | first_name | varchar(45) | The first name of the staff member. | |||||
The first name of the staff member. |
||||||||
3 | last_name | varchar(45) | The last name of the staff member. | |||||
The last name of the staff member. |
||||||||
4 | address_id | unsigned smallint(5, 0) | address | A foreign key to the staff member's address in the address table. | ||||
A foreign key to the staff member's address in the address table. References: address |
||||||||
5 | picture | blob | A BLOB containing a photograph of the employee. | |||||
A BLOB containing a photograph of the employee. |
||||||||
6 | varchar(50) | The staff member's email address. | ||||||
The staff member's email address. |
||||||||
7 | store_id | unsigned tinyint(3, 0) | store | The staff member's “home store”. The employee can work at other stores but is generally assigned to the store listed. | ||||
The staff member's “home store”. The employee can work at other stores but is generally assigned to the store listed. References: store |
||||||||
8 | active | tinyint(3, 0) | Default: 1 | Whether this is an active employee. If employees leave their rows are not deleted from this table, instead this column is set to FALSE. | ||||
Whether this is an active employee. If employees leave their rows are not deleted from this table, instead this column is set to FALSE. Default: 1 |
||||||||
9 | username | varchar(16) | The user name used by the staff member to access the rental system. | |||||
The user name used by the staff member to access the rental system. |
||||||||
10 | password | varchar(40) | The password used by the staff member to access the rental system. The password should be stored as a hash using the SHA1() function. | |||||
The password used by the staff member to access the rental system. The password should be stored as a hash using the SHA1() function. |
||||||||
11 | 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 | |
---|---|---|---|---|
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 |
||||
staff | store | staff.store_id = store.store_id | fk_staff_store Foreign key constraint referencing store.store_id |
|
staff.store_id = store.store_id Name: fk_staff_storeForeign key constraint referencing store.store_id |
||||
payment | staff | payment.staff_id = staff.staff_id | fk_payment_staff Foreign key constraint referencing staff.staff_id |
|
payment.staff_id = staff.staff_id Name: fk_payment_staffForeign key constraint referencing staff.staff_id |
||||
rental | staff | rental.staff_id = staff.staff_id | fk_rental_staff Foreign key constraint referencing staff.staff_id |
|
rental.staff_id = staff.staff_id Name: fk_rental_staffForeign key constraint referencing staff.staff_id |
||||
store | staff | store.manager_staff_id = staff.staff_id | fk_store_staff Foreign key constraint referencing staff.staff_id |
|
store.manager_staff_id = staff.staff_id Name: fk_store_staffForeign key constraint referencing staff.staff_id |
Unique keys
Key name | Columns | Description | |
---|---|---|---|
PRIMARY | staff_id | Primary key. | |
Primary key. |
Exported: 2018-10-12 17:43, Last imported: 2018-08-06 10:44