A2.2 JOBS Database Normalization

The following table contains how many hours employees spent on projects during a particular period. The table is only in first normal form because of all the partial dependencies

Columns: 10, Rows: 15
EIDFNAMELNAMEADDRESSCITYZIPPIDQTRPROJNAMEEHRS
11MaryJacobsP O Box 12022Honolulu9682810002019 Q3Product Plan30.00
21MaryJacobsP O Box 12022Honolulu9682812002019 Q3Tax Preparation25.00
31MaryJacobsP O Box 12022Honolulu9682813002019 Q4Product Plan35.00
42RosalieJacksonPO Box 1707Aiea9670112002019 Q3Tax Preparation20.00
54TomCaruthersPO Box 215Honolulu9681011002019 Q3Portfolio Analysis40.00
64TomCaruthersPO Box 215Honolulu9681012002019 Q3Tax Preparation45.00
74TomCaruthersPO Box 215Honolulu9681014002019 Q4Portfolio Analysis15.00
85HeatherJonesPO Box 2908Ewa Beach9670612002019 Q3Tax Preparation40.00
95HeatherJonesPO Box 2908Ewa Beach9670614002019 Q4Portfolio Analysis10.00
106MaryAbernathyPO Box 2999Aiea9670111002019 Q3Portfolio Analysis45.00
116MaryAbernathyPO Box 2999Aiea9670114002019 Q4Portfolio Analysis27.00
128TomJacksonPO Box 75457Kapolei9670710002019 Q3Product Plan75.00
138TomJacksonPO Box 75457Kapolei9670713002019 Q4Product Plan80.00
1410KenNumotoPO Box 1793Honolulu9680610002019 Q3Product Plan55.00
1510KenNumotoPO Box 1793Honolulu9680613002019 Q4Product Plan50.00

Employees each have an ID (EID), first and last name (FNAME, LNAME), and an address, city, and zip code (ADDRESS, CITY, ZIP).

Projects have a project ID (PID), quarter (QTR) and name (PROJNAME).

Employees worked projects for a certain number of hours (EHRS).

Assignment:

  1. Create an InnoDB database on your server named JOBS exactly.
  2. Import the above table into JOBS
    • Name the table "ORIGINAL"
    • Set PROJNAME to varchar(100), ADDRESS to varchar(50), FNAME, LNAME, CITY, QTR to varchar(25), ZIP to varchar(10), EHRS to decimal(9,2) and EID, PID to int().
    • Make sure you specify the primary key correctly
  3. Decompose the table into a set of BCNF tables in JOBS. Name your tables EMPLOYEE, PROJECT, EPHOURS and ZIPCITY
    • Make sure you specify the foreign keys correctly.
    • Make sure to populate the new tables from the original table.

When you are through, confirm you created your database correctly using the autograder.