Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inserting new fields into related tables

Status
Not open for further replies.

azalealee

Programmer
Nov 21, 2002
36
AU
Hi

I'm having troubles designing the tables for an organisational database.

I have 3 tables Division, Dept and Section, in a hierarchy order. ie, there are 7 Divisions, multiple departments in a division and multiple sections in a department. I have added these relationships by including the appropriate foreign keys. Each division, department and section have ID numbers which I have used as the primary keys.

My problem is that management might decide to add a new department or section, but still retain the same numbering for the rest. The number order is critical because it dictates the flow of work.

How am I able to insert a new field into a table without disturbing the other records in the same table and changing the foreign key numbers in related tables?

E.g if a new section 19 is added, all the sections from 19 onwards will have to change their ID's.

Thanks in advance.
 
Hi

Why not have a 'department' number (which the User sees) and an 'internal department' number which only the computer sees, in any renumbering exercise, you change only the Department number, the 'internal department' number remains unchanged, hence your logic is not disturbed. The Department the User sees is effectively simply an extension of the description.

Hope this helps Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top