|
 |
|
Oracle Tips by Burleson |
Employee Entity
In the above example, the employee entity
has the attributes defined as emp_num (employee number), ssn,
emp_name, hire_date and dept. The primary key (unique identifier)
is the employee number, identified as the key because it is
underlined. There are some key things to note about the employee
entity.
First, all employees are
going to be in a department, so the dept attribute will have a lot
of redundant information in it. Also, the department is not
dependent on the emp_num key, so we need to split it out into its
own entity. Secondly, you might want to use the social security
number (ssn) as the primary key; however, this will limit your
design to just persons with a ssn. No persons from other countries,
since they will not have a ssn. Finally, employee name should be
broken up into subelements such as first, middle initial and last
name.
The above book excerpt is from:
Easy Oracle
SQL
Get Started
Fast writing SQL Reports with SQL*Plus
ISBN 0-9727513-7-8
Col. John Garmany
http://www.rampant-books.com/book_2005_1_easy_sql.htm |