Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 24th, 2005, 06:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Default Whether or not to merge two tables

OK, a quick question of of style over substance here.

I have a database that someone else designed (very, very badly) and I'm trying to redesign it into something approaching a real db structure. Now, one table is called 'StaffMasterFile' and contains fields to do with the staff members (StaffID, names, network login etc), I also have another table called EmploymentStatus which contains data about current role, telephone number, desk ID, department and so on for each employee (foreign key on StaffID into StaffMasterFile). Currently there is a one-to-one mapping between the two tables because there is no history in the EmploymentStatus table.

I'm wondering whether to combine the two tables into one wider table, or two maintain two separate tables in case someone decides that recording historical employment info would be a good idea. Murphy's law implies that if I merge them then the requirement for history will materialise, but if I leave them separated it's an unecessary overhead in the database.

your thoughts, please

Chris


There are two secrets to success in this world:
1. Never tell everything you know
__________________
There are two secrets to success in this world:
1. Never tell everything you know
 
Old November 24th, 2005, 06:18 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

IMO if thee is a one to one relationship, yes merge them. What I mean by this:

;;;EmploymentStatus which contains data about current role, telephone number, desk ID, department

If each person has one current role, one telehone number (you may place several ph fields when you merge them, MB, HM, FAX etc), one desk etc... Yes merge them

;;;Murphy's law implies that if I merge them then the requirement for history will materialise

This is fine, have a one to many relationship between the StaffMasterFile table and a new table EG StaffHistory.

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
DataSet - Merge Data Tables srish ADO.NET 0 September 8th, 2007 10:04 AM
Need to merge several tables with unlike structure CORiverRat Access 5 December 14th, 2005 12:58 PM
How to Merge Tables into one query sorcerer Access 5 March 11th, 2005 04:19 AM
Word E-Mail Merge using Access Tables Richard Lally Access 2 February 7th, 2005 04:48 AM
How can I merge two databases and tickets tables? drarem Access VBA 2 October 5th, 2004 01:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.