0

enter image description here

That is the structure of my original employees table .

This is the employees table from a different database that i want to be merged with my original employees table: enter image description here

Its tricky because they have different structures. I was thinking of just adding the columns from the new employees table to the original employees table.

4
  • 1
    why is full name primary key OMG Commented Feb 20, 2013 at 17:22
  • @GGio I didn't make that. It was just from an open source Time Clock software from: timeclock.sourceforge.net Commented Feb 20, 2013 at 17:25
  • I guess they dont have 2 John Smith Commented Feb 20, 2013 at 17:25
  • I would map any fields you can. Then add the others. Commented Feb 20, 2013 at 17:25

1 Answer 1

1

What i would do is drop both tables and create NORMALIZED TABLES. Right now both of the tables are not normalized and if you perform a lot of queries on these tables it will be slow.

Instead you can split both tables and get necessary info for example:

   Users Table Columns (ID, UserName, Password, CreateDate etc...)
   Users Info Table Columns (ID, FirstName, LastName, Gender, Age etc....)
   User Activation Table (ID, UserActive, ActivationDate, DeActivationDate etc.)

and use foreign keys to reference to ID from other 2 tables. Read up on relational databasees

Sign up to request clarification or add additional context in comments.

3 Comments

Drop the table? I'm pretty sure that's not a great idea now since I dont have much time left and I didn't make this system so it might ruin the working php system. So I have no choice but to stick with the unnormalized tables. :(
then figure out which columns are used in PHP and merge them. FullName will not be necessary since you have first and last names in first table so find in PHP where it uses FullName and split to use First and Last names. P.S. DONT USE FullName as primary key
Would just adding the columns from the new employees table to my original employees table work? If so, how can i move those columns to the original employess table?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.