HR
| Table Name: | DEPARTMENTS |
| Description: | Departments table that shows details of departments where employees work. Contains 27 rows; references with locations, employees, and job_history tables. |
| Primary Keys: | DEPARTMENT_ID |
| Field | Type | Defaults | Nulls? | Comments |
|---|---|---|---|---|
| DEPARTMENT_ID | NUMBER (4) | None | No | Primary key column of departments table. |
| DEPARTMENT_NAME | VARCHAR2 (30) | None | No | A not null column that shows name of a department. Administration, Marketing, Purchasing, Human Resources, Shipping, IT, Executive, Public Relations, Sales, Finance, and Accounting. |
| MANAGER_ID | NUMBER (6) | None | Yes | Manager_id of a department. Foreign key to employee_id column of employees table. The manager_id column of the employee table references this column. |
| LOCATION_ID | NUMBER (4) | None | Yes | Location id where a department is located. Foreign key to location_id column of locations table. |
| Index | Type | Unique? | Fields |
|---|---|---|---|
| DEPT_ID_PK | NORMAL | Yes | DEPARTMENT_ID |
| DEPT_LOCATION_IX | NORMAL | No | LOCATION_ID |
| Internal Foreign Key Constraint | Affected Field | Source Table | Source Schema |
|---|---|---|---|
| DEPT_LOC_FK | LOCATION_ID | LOCATIONS | HR |
| DEPT_MGR_FK | MANAGER_ID | EMPLOYEES | HR |
| Primary Key as Foreign Key Constraint | Affected Schema | Affected Table | Affected Field |
|---|---|---|---|
| EMP_DEPT_FK | HR | EMPLOYEES | DEPARTMENT_ID |
| JHIST_DEPT_FK | HR | JOB_HISTORY | DEPARTMENT_ID |