0

I am designing a database system to store salary information. It includes different tables (salary,personal info , ect)

I want to make it use for different companies. Also i want each set of data to be separated. (by company wise). (i.e. i dnt want all the employee names of every company in one table!!)
what would be the best database structure for that.??

i tried 1. one db for 1 company
That looks like invain.

please help me. I jst want an idea. thankx in advance

Edited by Reverend Jim: Fixed formatting

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Gilette
0

One employee cannot work for multiple company , have 2 table one for employee and one for company .

0

One employee cannot work for multiple company , have 2 table one for employee and one for company .

A table for employee with private info for each one sounds right to start with. Another table for companies with the company information also sounds right. The question is probably; where in lies the relation in between an employee and a company and how does it look like. The answer would probably result in another table filled with foreign keys involving both employees and companies. In this relational table, a foreign key involving one company is related to a foreign key to a employee. There can be several relations for a company to employees, meaning a company can have more than one employee. At the same time, there can be several relations for an employee to companies, meaning an employee can work for more than one company. By this understanding we can define this relational table as a "many-to-many". In conclusion, what I see are two tables that lists employees and companies, and a relational many-to-many table. Using this set of tables is easy when "where" query statement is used. Remember this... data in a database is of no usage if u cannot search for it, just like the complete Internet would be useless if information couldn't be retrieved from it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.