For this lab exercise, you will deal with four tables for the CoyoteCorp DB.
Table Name | Attributes | Primary key | Description |
EMPLOYEES | empNo | An individual who works in CoyoteCorp | |
empNo | Unique id, format 9999 | ||
fname | First name of the employee | ||
lname | Last name of the employee | ||
address | Home address of the employee | ||
sex | Gender of the employee F-female or M-male | ||
salary | Yearly salary of the employee, format 999999, salary cannot be lower than $12,000 | ||
position | Job role of the employee in CoyoteCorp - clerk, programmer, manager, sale representative, account representative, dba | ||
deptNo | Department number that this employee works for, format 99 An employee can work in only one department and a department can have more then one employee. Every employee must work in a department. Every department must have at least employee. Not every employee will manage a department. An employee need not work on a project. But every project must have at least one employee working on it. | ||
DEPARTMENTS | deptNo | A functional division within CoyoteCorp | |
deptNo | Unique id, format 99 | ||
deptName | Name of the functional division - IT, Sales, Accounting, Marketing, Administration | ||
Mgr | Employee number of the manager of the department. A department must have a manager. | ||
PROJECTS | projNo | Piece of planned work or an activity that is finished over a period of time | |
projNo | Unique id, format 99 | ||
projName | Name of planned work/activity - Computeration, ProductX, ProductY, etc | ||
deptNum | Department that controls the project - format 99 A department controls many projects but a project can be controlled by only one department. A department need not control a project. Every project must be controlled by a department. | ||
EMP_PROJ | (empNo, projNo) | Details of the hours worked by the employee on each project | |
empNo | Unique id, format 9999 | ||
projNo | Unique id, format 9999 | ||
hourSpent | Number of hours spent by the employee in the project |
EMP Data
empNo | fname | lname | address | sex | salary | position | deptNo |
1000 | Steven | King | 731 Fondren, Houston, TX | M | 30000 | Programmer | 60 |
1007 | Diana | Lorentz | 638 Voss, Bellaire, TX | F | 24000 | Clerk | 20 |
2002 | Pat | Fay | 3321 Castle, Spring, TX | F | 15000 | Sales Representative | 80 |
1760 | Jonathan | Taylor | 561 Rice, Houston, TX | M | 60000 | Manager | 20 |
1740 | Ellen | Abel | 890 Stone, Houston, TX | F | 65000 | Manager | 60 |
2060 | William | Gietz | 450 Berry, Bellaire, TX | M | 65000 | Manager | 80 |
2000 | Jennifer | Whalen | 980 Fire Oak, Humble, TX | F | 28000 | Clerk | 60 |
1444 | Peter | Vargas | 975 Dallas, Houston, TX | M | 20000 | Sales Representative | 80 |
DEPT Data
deptNumber | deptName | Mgr |
20 | Marketing | 1760 |
60 | IT | 1740 |
80 | Sales | 2060 |
PROJ Data
projNumber | projName | deptNum |
10 | Product X | 20 |
20 | Product Y | 20 |
30 | Computerization | 60 |
40 | Product Z | 80 |
50 | Mobile Apps | 60 |
EMP_PROJ Data
empNo | projNo | hoursWorked |
1000 | 30 | 32.5 |
1000 | 50 | 7.5 |
2002 | 10 | 40.0 |
1444 | 20 | 20.0 |
1760 | 10 | 5.0 |
1760 | 20 | 10.0 |
1740 | 50 | 15.0 |
2060 | 40 | 12.0 |
What to do