Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 24th, 2005, 06:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: London, , United Kingdom.
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
Reply With Quote
  #2 (permalink)  
Old November 24th, 2005, 06:18 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:00 AM.


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