# personnel ## Purpose The **personnel** table serves as the central registry for all facility staff; except D-Class personnel. It stores static personnel information including identity, clearance level, assigned role, residential assignment and employment status. ## Columns | Field | Type | Description |-------------|-------------|------------------------------------------------------------------------------------| | id_per | MEDIUMINT | Unique personnel identifier (PK, AUTO_INCREMENT) | title | VARCHAR(30) | Optional academic or professional title (e.g.: Ph.D., M.D., Sc.D.) | first_name | VARCHAR(50) | First name of personnel | last_name | VARCHAR(50) | Last name of personnel | clearance | TINYINT | Security clearance level assigned to the personnel | role | VARCHAR(100)| Job role within the facility | id_bed | MEDIUMINT | Assigned residential bedroom (FK, NULLABLE) | status | ENUM | Current employment status and availabity within the facility | reg_key | VARCHAR(19) | Unique registration key used to register in the web application (nullable, unique) |----------------------------------------------------------------------------------------------------------------| ### ENUM values - status = ('active','unavailable','retired','deceased') ## Relationships - References **bedroom.id_bed** through **id_bed** to assign personnel to residential units within the facility. - Referenced by **login.id_per** to link personnel accounts to authentication credentials. - Referenced by **personnel_state.id_per** to store runtime operational and health status data. - Referenced by **personnel_mtf.id_per** to assign personnel to Mobile Task Force units. - Referenced by **experiment_personnel.id_per** to track personnel participation in experiments. - Referenced by **activity_log.id_per** to record personnel-related actions and system events. - Referenced by **incident_log.id_per** to record personnel involvement in security or safety incidents. ## Rules - Each `id_bed` can be assigned to only one personnel member. - `role` values must be lower-case for clear SELECT and JOIN operations. - `reg_key` must be unique when present to prevent other personnel registeting as someone else. ## Example output +--------+-------+------------+-----------+-----------+---------------+--------+--------+---------+ | id_per | title | first_name | last_name | clearance | role | id_bed | status | reg_key | +--------+-------+------------+-----------+-----------+---------------+--------+--------+---------+ | 1 | Sc.D. | Elias | Ford | 4 | site director | 1 | active | NULL | +--------+-------+------------+-----------+-----------+---------------+--------+--------+---------+