Results 1 to 2 of 2

Thread: normalisation

  1. #1
    Join Date
    Dec 1969

    Default normalisation

    Hi,<BR><BR><BR>I have a problem when I did normalisation with my table.It goes like this !<BR><BR> In the beginning, I had a table,with fields like<BR> * Company Name<BR> * Employee code<BR> * Employee name<BR> * Designation<BR> * Place of posting<BR> * e-mail <BR><BR> As part of the normalisation , I split the table into two,with <BR>Table 1 having:<BR> * Compamy name <BR> * Designation<BR> * Place of posting<BR> * Employee code (foreign key)<BR><BR> and Table 2 having :<BR><BR> *Employee code (primary key)<BR> *Employee Name<BR> *e-mail. <BR><BR><BR> My doubts arise now,<BR><BR>1. How do I insert data into these tables.<BR><BR> Can I use the normal,"insert into Table 1 values,....... and <BR> insert into Table 2 values,.........<BR><BR> My question here is, if I am entering data into these tables for the first time I won&#039t have a problem.<BR> But when I enter the details of another employee who is from the same company,who has the same designation and has the same place of posting,will there be a duplication of data (in Table 2) if I use above method to insert values into Table 1 & Table 2.<BR><BR> I feel that when there is duplication of data the normalisation is <BR>not proper.<BR><BR><BR> Can someone help me ? It would be nice if you could include your e-mail address also.Since I am a beginner I do have a lot of doubts like this. I just wanted to clarify them.<BR><BR> You could contact me at<BR><BR> Thanks<BR><BR>rajesh

  2. #2 Guest

    Default RE: normalisation

    I think the normalisation should go:<BR>Table 1 <BR>* Company Code (primary key)<BR>* Compamy name <BR>* Designation<BR>* Place of posting<BR><BR>Table 2<BR>* Employee code (primary key)<BR>* Company Code (foreign key)<BR>* Employee Name<BR>* e-mail. <BR><BR>This way there are two entities Companies and Employees. When an employee is entered he needs only one extra field to identify the company. There would be a one to many relationship between companies and employees. Employees are related back to the company via [Company Code].<BR><BR>Of course this assumes that employees can only work for one company. If an employee works for two different companies then you would need to further split the employee table:<BR><BR>Table 2a <BR>* Employee code (primary key)<BR>* Company Code (foreign key)<BR><BR>table 2b<BR>* Employee code (primary key)<BR>* Employee Name<BR>* e-mail. <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts