Sunteți pe pagina 1din 17

ENTITIES

Number of Entities: 6 Name of Entities: 1. Client 2. Project 3. Employee 4. Time Card 5. Time Card Expense File 6. Invoice No 1 Client Entity

ATTRIBUTES

2 Project

3 Employee

4 Time Card

5 Time Card Expense File

6 Invoice

ATTRIBUTES
Attributes Client_Code Company_Name Address Country Contact_Person Phone Project_Code Cline_Code Employee_Code Project_Name Project_Description Estimate_Bill Start_Date End_Date Employee_Code Employee_Name Address Country Work_Phone Billing_Rate Time_Card_ID Employee_ID Data_Issued Data_Worked Project_ID Work_Description Billable_Hours Work_Code Time_Card_Expense_ID Time_Card_ID Expense_Date Expense_Amount Expense_Description Project_ID Expense_Code_ID Expense_Code_ID Payment_Code Payment_Mode_ID Payment_Mode_Name Corresponding_Project_Code Expense_Amount Payment_Amount Payment_Date

Card_Number Card_Holders_Name Expiry_Date_Of_Card

TABLES
Number of Tables : 7 Structure of Tables: CLIENT (Entity) CLIENT Client_Code Company_Name Address Country Contact_Person Phone PROJECT (Entity) PROJECT Project_Code Client_Code Employee_Code Project_Name Project_Description Estimate_Bill Start_Date End_Date

EMPLOYEE (Entity) EMPLOYEE Employee_Code Employee_Name Address Country Work_Phone Billing_Rate

TIME CARD DETAILS (Entity) TIME CARD DETAILS Time_Card_ID Employee_ID Data_Issued Data_Worked Project_ID Work_Description Billable_Hours Work_Code_ID

INVOICE (Entity) INVOICE Payment_Code Payment_Mode_ID Payment_Mode_Name Corresponding_Project_Code Expense_Amount Payment_Amount Payment_Date Card_Number Card_Holders Name Expiry_Date_Of_Card

PROJECT DETAILS (Relationship) PROJECT DETAIL Project_Details_ID Project_Code Client_Code Bill_Estimated Actual_Ammount Discount Total_Cost

TIME CARD EXPENSES (Entity) TIME CARD EXPENSE Time_Card_Expense_ID Time_Card_ID Expense_Date Expense_Amount Expense_Description Project_ID Expense_Code_ID Expense_Code

TABLES AFTER 1 NF
CLIENT CLIENT Client_Code Company_Name Address Country Contact_Person Phone PROJECT PROJECT Project_Code Client_Code Employee_Code Project_Name Project_Description Estimate_Bill Start_Date End_Date

EMPLOYEE EMPLOYEE Employee_Code Employee_Name Address Country Work_Phone Billing_Rate

TIME CARD DETAILS TIME CARD DETAILS Time_Card_ID Employee_ID Data_Issued Data_Worked Project_ID Work_Description Billable_Hours Work_Code_ID

INVOICE INVOICE Payment_Code Payment_Mode_ID Payment_Mode_Name Corresponding_Project_Code Expense_Amount Payment_Amount Payment_Date Card_Number Card_Holders Name Expiry_Date_Of_Card

PROJECT DETAILS PROJECT DETAIL Project_Details_ID Project_Code Client_Code Bill_Estimated Actual_Ammount Discount Total_Cost

TIME CARD EXPENSES TIME CARD EXPENSE Time_Card_Expense_ID Time_Card_ID Expense_Date Expense_Amount Expense_Description Project_ID Expense_Code_ID Expense_Code

TABLES AFTER 2 NF
CLIENT CLIENT Client_Code Company_Name Address Country Contact_Person Phone PROJECT PROJECT Project_Code Client_Code Employee_Code Project_Name Project_Description Estimate_Bill Start_Date End_Date

EMPLOYEE EMPLOYEE Employee_Code Employee_Name Address Country Work_Phone Billing_Rate

TIME CARD DETAILS TIME CARD DETAILS Time_Card_ID Employee_ID Data_Issued Data_Worked Project_ID Work_Description Billable_Hours Work_Code_ID

INVOICE INVOICE Payment_Code Payment_Mode_ID Payment_Mode_Name Corresponding_Project_Code Expense_Amount Payment_Amount Payment_Date Card_Number Card_Holders Name Expiry_Date_Of_Card

EXPENSES (added table) EXPENSES Expense_Code_ID Expense_Code Project_ID Expense_Description Expense_Date Expense_Amount

PROJECT DETAILS PROJECT DETAIL Project_Details_ID Project_Code Client_Code Bill_Estimated Actual_Ammount Discount Total_Cost

TIME CARD EXPENSES TIME CARD EXPENSE Time_Card_Expense_ID Time_Card_ID Expense_Date Expense_Amount Expense_Description Project_ID Expense_Code_ID Expense_Code

TABLES AFTER 3 NF
In the Time Card Expenses table the Expense Code depends on Expense Code ID not on Time Card Expense ID. Therefore, for the tables to be in 3 NF, we need to create another table, Expenses. Also in the Invoice table, the attribute Payment Mode Name depends on Paymnet Mode ID and not on Paymnet Code. Therefore, we need to create a separate table Payment Modes. In addition, the attributes Card Holders Name and Expiry Date of Card depend on Card Number not Payment Code. Therefore we need to create another table Credit Cards. The updated table structures are shown here: CLIENT CLIENT Client_Code Company_Name Address Country Contact_Person Phone PROJECT PROJECT Project_Code Client_Code Employee_Code Project_Name Project_Description Estimate_Bill Start_Date End_Date

EMPLOYEE EMPLOYEE Employee_Code Employee_Name Address Country Work_Phone Billing_Rate

TIME CARD DETAILS TIME CARD DETAILS Time_Card_ID Employee_ID Data_Issued Data_Worked Project_ID Work_Description Billable_Hours Work_Code_ID

INVOICE INVOICE Payment_Code Payment_Mode_ID Corresponding_Project_Code Expense_Amount Payment_Amount Payment_Date

Card_Number

CREDIT CARDS CREDIT CARDS Credit_Card_Number Card_Holders_Name Expiry_Date_Of_Card

PROJECT DETAILS PROJECT DETAIL Project_Details_ID Project_Code Client_Code Bill_Estimated Actual_Ammount Discount Total_Cost

TIME CARD EXPENSES TIME CARD EXPENSE Time_Card_Expense_ID Time_Card_ID Project_ID Expense_Code_ID

PAYMENT MODES PAYMENT MODES Paymnet_Mode_ID Payment_Mode_Name

TABLES AFTER DENORMALIZATION


When we place the information about credit card in a separate table, the query performance during the generation of payment receipt will get affected due to creation of joins in every payment receipt. Therefore, for optimum performance, we denormalize and place the credit card information back into the invoice table. The updated table structures are shown here: CLIENT CLIENT Client_Code Company_Name Address Country Contact_Person Phone PROJECT PROJECT Project_Code Client_Code Employee_Code Project_Name Project_Description Estimate_Bill Start_Date End_Date

EMPLOYEE EMPLOYEE Employee_Code Employee_Name Address Country Work_Phone Billing_Rate

TIME CARD DETAILS TIME CARD DETAILS Time_Card_ID Employee_ID Data_Issued Data_Worked Project_ID Work_Description Billable_Hours Work_Code_ID

INVOICE INVOICE Payment_Code Payment_Mode_ID Corresponding_Project_Code Expense_Amount Payment_Amount Payment_Date Card_Number Card_Holders_Name Expiry_Date_Of_Card

EXPENSES EXPENSES Expense_Code_ID Expense_Code Project_ID Expense_Description Expense_Date Expense_Amount

PROJECT DETAILS PROJECT DETAIL Project_Details_ID Project_Code Client_Code Bill_Estimated Actual_Ammount Discount Total_Cost

TIME CARD EXPENSES TIME CARD EXPENSE Time_Card_Expense_ID Time_Card_ID Project_ID Expense_Code_ID

PAYMENT MODES PAYMENT MODES Paymnet_Mode_ID Payment_Mode_Name

PRIMARY AND FOREIGN KEYS


The primary and Foreign keys (whenever applicable) for each table are listed with their respective tables names: No 1 2 3 4 5 6 7 8 9 Table Client Project Project Details Employee Time Card Details Time Card Expenses Invoice Expenses Payment Modes Primary Key Client_Code Project_Code Project_Details_ID Employee_Code Time_Card_ID Time_Card_Expenses_ID Payment_Code Expense_Code_ID Payment_Mode_ID

each table are listed with their respective tables names: Foreign Key Client_Code, Employee Code Project_Code, Client_Code Employee_ID, Project_ID Payment_Mode_ID, Project_Code, Expense_Amount Project_ID, Expense Amount -

S-ar putea să vă placă și