Editing HR.EMPLOYEES (table)

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 2: Line 2:
  
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
|- valign="top"
+
|-
 
| '''Table
 
| '''Table
 
| HR.EMPLOYEES
 
| HR.EMPLOYEES
|- valign="top"
+
|-
| '''Description
 
| employees table. Contains 107 rows. References with departments,
 
jobs, job_history tables. Contains a self reference.
 
 
|}
 
|}
  
=== 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 18: Line 15:
 
| '''Nullable
 
| '''Nullable
 
| '''Default
 
| '''Default
| '''Description
+
| '''PK
 
+
| '''Index
|- valign="top"
+
 +
|-
 
| EMPLOYEE_ID
 
| EMPLOYEE_ID
 
| NUMBER(6, 0)
 
| NUMBER(6, 0)
 
| not null
 
| not null
 
|  
 
|  
| Primary key of employees table.
+
| EMP_EMP_ID_PK
|- valign="top"
+
|
 +
|-
 
| FIRST_NAME
 
| FIRST_NAME
 
| VARCHAR2(20)
 
| VARCHAR2(20)
 
| null
 
| null
 
|  
 
|  
| First name of the employee. A not null column.
+
|  
|- valign="top"
+
| EMP_NAME_IX
 +
|-
 
| LAST_NAME
 
| LAST_NAME
 
| VARCHAR2(25)
 
| VARCHAR2(25)
 
| not null
 
| not null
 
|  
 
|  
| Last name of the employee. A not null column.
+
|  
|- valign="top"
+
| EMP_NAME_IX
 +
|-
 
| EMAIL
 
| EMAIL
 
| VARCHAR2(25)
 
| VARCHAR2(25)
 
| not null
 
| not null
 
|  
 
|  
| Email id of the employee
+
|  
|- valign="top"
+
| EMP_EMAIL_UK
 +
|-
 
| PHONE_NUMBER
 
| PHONE_NUMBER
 
| VARCHAR2(20)
 
| VARCHAR2(20)
 
| null
 
| null
 
|  
 
|  
| Phone number of the employee; includes country code and area code
+
|  
|- valign="top"
+
|
 +
|-
 
| HIRE_DATE
 
| HIRE_DATE
 
| DATE(7)
 
| DATE(7)
 
| not null
 
| not null
 
|  
 
|  
| Date when the employee started on this job. A not null column.
+
|  
|- valign="top"
+
|
 +
|-
 
| JOB_ID
 
| JOB_ID
 
| VARCHAR2(10)
 
| VARCHAR2(10)
 
| not null
 
| not null
 
|  
 
|  
| Current job of the employee; foreign key to job_id column of the
+
|  
jobs table. A not null column.
+
| EMP_JOB_IX
|- valign="top"
+
|-
 
| SALARY
 
| SALARY
 
| NUMBER(8, 2)
 
| NUMBER(8, 2)
 
| null
 
| null
 
|  
 
|  
| Monthly salary of the employee. Must be greater
+
|  
than zero (enforced by constraint emp_salary_min)
+
|
|- valign="top"
+
|-
 
| COMMISSION_PCT
 
| COMMISSION_PCT
 
| NUMBER(2, 2)
 
| NUMBER(2, 2)
 
| null
 
| null
 
|  
 
|  
| Commission percentage of the employee; Only employees in sales
+
|  
department elgible for commission percentage
+
|
|- valign="top"
+
|-
 
| MANAGER_ID
 
| MANAGER_ID
 
| NUMBER(6, 0)
 
| NUMBER(6, 0)
 
| null
 
| null
 
|  
 
|  
| Manager id of the employee; has same domain as manager_id in
+
|  
departments table. Foreign key to employee_id column of employees table.
+
| EMP_MANAGER_IX
(useful for reflexive joins and CONNECT BY query)
+
|-
|- valign="top"
 
 
| DEPARTMENT_ID
 
| DEPARTMENT_ID
 
| NUMBER(4, 0)
 
| NUMBER(4, 0)
 
| null
 
| null
 
|  
 
|  
| Department id where employee works; foreign key to department_id
+
|  
column of the departments table
 
|}
 
 
 
=== Primary Key ===
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
|- style="background:silver"
 
| '''Primary Key
 
| '''Columns
 
|- valign="top"
 
| EMP_EMP_ID_PK
 
| EMPLOYEE_ID
 
|}
 
 
 
=== Indexes ===
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
|- style="background:silver"
 
| '''Index
 
| '''Type
 
| '''Columns
 
 
 
|- valign="top"
 
 
| EMP_DEPARTMENT_IX
 
| EMP_DEPARTMENT_IX
|
 
| DEPARTMENT_ID
 
|- valign="top"
 
| EMP_EMAIL_UK
 
|
 
| EMAIL
 
|- valign="top"
 
| EMP_JOB_IX
 
|
 
| JOB_ID
 
|- valign="top"
 
| EMP_MANAGER_IX
 
|
 
| MANAGER_ID
 
|- valign="top"
 
| EMP_NAME_IX
 
|
 
| LAST_NAME, FIRST_NAME
 
 
|}
 
|}
  
=== Check Constraints ===
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
|- style="background:silver"
 
| '''Check Constraint
 
| '''Expression
 
| '''Description
 
  
|- valign="top"
 
| EMP_EMAIL_NN
 
| "EMAIL" IS NOT NULL
 
|
 
|- valign="top"
 
| EMP_HIRE_DATE_NN
 
| "HIRE_DATE" IS NOT NULL
 
|
 
|- valign="top"
 
| EMP_JOB_NN
 
| "JOB_ID" IS NOT NULL
 
|
 
|- valign="top"
 
| EMP_LAST_NAME_NN
 
| "LAST_NAME" IS NOT NULL
 
|
 
|- valign="top"
 
| EMP_SALARY_MIN
 
| salary > 0
 
|
 
|}
 
  
=== 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 168: Line 104:
 
| '''Column
 
| '''Column
 
| '''Referenced Column
 
| '''Referenced Column
 
+
|- valign="top"
+
|-
 
| [[HR.DEPARTMENTS_(table)|HR.DEPARTMENTS]]
 
| [[HR.DEPARTMENTS_(table)|HR.DEPARTMENTS]]
 
| DEPARTMENT_ID
 
| DEPARTMENT_ID
 
| DEPARTMENT_ID
 
| DEPARTMENT_ID
|- valign="top"
+
|-
 
| [[HR.JOBS_(table)|HR.JOBS]]
 
| [[HR.JOBS_(table)|HR.JOBS]]
 
| JOB_ID
 
| JOB_ID
 
| JOB_ID
 
| JOB_ID
|- valign="top"
+
|-
 
| [[HR.EMPLOYEES_(table)|HR.EMPLOYEES]]
 
| [[HR.EMPLOYEES_(table)|HR.EMPLOYEES]]
 
| MANAGER_ID
 
| MANAGER_ID
Line 183: Line 119:
 
|}
 
|}
  
=== 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 189: Line 125:
 
| '''Column
 
| '''Column
 
| '''Referencing Column
 
| '''Referencing Column
 
+
|- valign="top"
+
|-
 
| [[OE.CUSTOMERS_(table)|OE.CUSTOMERS]]
 
| [[OE.CUSTOMERS_(table)|OE.CUSTOMERS]]
 
| EMPLOYEE_ID
 
| EMPLOYEE_ID
 
| ACCOUNT_MGR_ID
 
| ACCOUNT_MGR_ID
|- valign="top"
+
|-
 
| [[HR.DEPARTMENTS_(table)|HR.DEPARTMENTS]]
 
| [[HR.DEPARTMENTS_(table)|HR.DEPARTMENTS]]
 
| EMPLOYEE_ID
 
| EMPLOYEE_ID
 
| MANAGER_ID
 
| MANAGER_ID
|- valign="top"
+
|-
 
| [[HR.EMPLOYEES_(table)|HR.EMPLOYEES]]
 
| [[HR.EMPLOYEES_(table)|HR.EMPLOYEES]]
 
| EMPLOYEE_ID
 
| EMPLOYEE_ID
 
| MANAGER_ID
 
| MANAGER_ID
|- valign="top"
+
|-
 
| [[HR.JOB_HISTORY_(table)|HR.JOB_HISTORY]]
 
| [[HR.JOB_HISTORY_(table)|HR.JOB_HISTORY]]
 
| EMPLOYEE_ID
 
| EMPLOYEE_ID
 
| EMPLOYEE_ID
 
| EMPLOYEE_ID
|- valign="top"
+
|-
 
| [[OE.ORDERS_(table)|OE.ORDERS]]
 
| [[OE.ORDERS_(table)|OE.ORDERS]]
 
| EMPLOYEE_ID
 
| EMPLOYEE_ID
 
| SALES_REP_ID
 
| SALES_REP_ID
 
|}
 
|}

Please note that all contributions to dbscript Online Help may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Project:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)