permaculture playing cards*
The moose likes JDBC and the fly likes Need help on creating tables for a simple scenario Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Need help on creating tables for a simple scenario" Watch "Need help on creating tables for a simple scenario" New topic
Author

Need help on creating tables for a simple scenario

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
Here is the scenario a company has a no of employees however some of those employees could be working for multiple companies having one to many relationships.
How would i describe them so far i only have two tables Employees_Info (containing employees details) and company_info(containg company deatails) how can i affiliate an employee with a company considering the fact that an employee could be working for multiple companies.

Employees_Info table:
ID|Name|Salary|Hours|designation

company_info table:
ID|Company_name|Employees_No

Now what changes should i make so that i can affiliate an Employee with multiple companies any ideas suggestions??
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

what you have is a link table, with an employee id and company id.
 
 
subject: Need help on creating tables for a simple scenario