Difference between revisions of "HR.DEPARTMENTS (table)"

From dbscript Online Help
Jump to: navigation, search
Line 5: Line 5:
 
| '''Table
 
| '''Table
 
| HR.DEPARTMENTS
 
| HR.DEPARTMENTS
 +
|- valign="top"
 +
| '''Description
 +
| Departments table that shows details of departments where employees
 +
work. Contains 27 rows; references with locations, employees, and job_history tables.
 
|-
 
|-
 
|}
 
|}
  
  
 +
=== Columns ===
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
|- style="background:silver"
 
|- style="background:silver"
Line 15: Line 20:
 
| '''Nullable
 
| '''Nullable
 
| '''Default
 
| '''Default
| '''PK
+
| '''Description
| '''Index
 
 
 
 
|-
 
|-
Line 23: Line 27:
 
| not null
 
| not null
 
|  
 
|  
| DEPT_ID_PK
+
| Primary key column of departments table.
|
 
 
|-
 
|-
 
| DEPARTMENT_NAME
 
| DEPARTMENT_NAME
Line 30: Line 33:
 
| not null
 
| not null
 
|  
 
|  
|  
+
| 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
 
| MANAGER_ID
Line 37: Line 41:
 
| null
 
| null
 
|  
 
|  
|  
+
| 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
 
| LOCATION_ID
Line 44: Line 47:
 
| null
 
| null
 
|  
 
|  
 +
| Location id where a department is located. Foreign key to location_id column of locations table.
 +
|}
 +
 +
=== Primary Key ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Primary Key
 +
| '''Columns
 +
|-
 +
| DEPT_ID_PK
 +
| DEPARTMENT_ID
 +
|}
 +
 +
=== Indexes ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Index
 +
| '''Type
 +
| '''Columns
 +
 +
|-
 +
| DEPT_LOCATION_IX
 
|  
 
|  
| DEPT_LOCATION_IX
+
| LOCATION_ID
 
|}
 
|}
  
 +
=== Check Constraints ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Check Constraint
 +
| '''Expression
 +
| '''Description
 +
 +
|-
 +
| DEPT_NAME_NN
 +
| "DEPARTMENT_NAME" IS NOT NULL
 +
|
 +
|}
  
 
+
=== Foreign Keys ===
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
|- style="background:silver"
 
|- style="background:silver"
Line 66: Line 103:
 
|}
 
|}
  
 
+
=== Detail Tables ===
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
|- style="background:silver"
 
|- style="background:silver"
Line 81: Line 118:
 
| DEPARTMENT_ID
 
| DEPARTMENT_ID
 
| DEPARTMENT_ID
 
| DEPARTMENT_ID
 +
|}
 +
 +
=== Dependencies ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Reference Type
 +
| '''Object Type
 +
| '''Referencing Object
 +
 +
|-
 +
| Select
 +
| View
 +
| [[OE.DEPTVIEW_(view)|OE.DEPTVIEW]]
 +
 
|}
 
|}

Revision as of 08:26, 11 February 2010

wikibot

Table HR.DEPARTMENTS
Description Departments table that shows details of departments where employees

work. Contains 27 rows; references with locations, employees, and job_history tables.


Columns

Column Data Type Nullable Default Description
DEPARTMENT_ID NUMBER(4, 0) not null Primary key column of departments table.
DEPARTMENT_NAME VARCHAR2(30) not null 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, 0) null 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, 0) null Location id where a department is located. Foreign key to location_id column of locations table.

Primary Key

Primary Key Columns
DEPT_ID_PK DEPARTMENT_ID

Indexes

Index Type Columns
DEPT_LOCATION_IX LOCATION_ID

Check Constraints

Check Constraint Expression Description
DEPT_NAME_NN "DEPARTMENT_NAME" IS NOT NULL

Foreign Keys

Relation Column Referenced Column
HR.LOCATIONS LOCATION_ID LOCATION_ID
HR.EMPLOYEES MANAGER_ID EMPLOYEE_ID

Detail Tables

Detail Table Column Referencing Column
HR.EMPLOYEES DEPARTMENT_ID DEPARTMENT_ID
HR.JOB_HISTORY DEPARTMENT_ID DEPARTMENT_ID

Dependencies

Reference Type Object Type Referencing Object
Select View OE.DEPTVIEW