If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Work Breakdown structure and normalization
Hi,
I'm working with work breakdown structure codes: 1.0.1.123 or 1.23.32, etc that seem to be very difficult to sort as text. So I broke them down and converted them to integers into an array so that 1.0.1.123 as text became Array(0) = 1 Array(1) = 0 Array(2)= 1 Array(3)=123 as integer Then I took the integer array and appended a table with its values and sorted that way. So on one table I have Field 1 Field2 Field3 Field4 Field5 1.0.1.123 1 0 1 123 And Another table I have Field 1 Field 2 Field3 Field4 1.0.0.123 More pertinent stuff etc....... Obviously these two tables have a 1 to 1 relationship. Am I violating any major laws of database design by going this way? Is there a better way? Thanks Paolo |
#2
|
|||
|
|||
Work Breakdown structure and normalization
Paolo wrote: I'm working with work breakdown structure codes: 1.0.1.123 or 1.23.32, etc that seem to be very difficult to sort as text. So I broke them down and converted them to integers So on one table I have Field 1 Field2 Field3 Field4 Field5 1.0.1.123 1 0 1 123 And Another table I have Field 1 Field 2 Field3 Field4 1.0.0.123 More pertinent stuff etc....... Obviously these two tables have a 1 to 1 relationship. Am I violating any major laws of database design by going this way? You are breaking a theoretical rule that says you shouldn't store the results of a 'calculation' (being a concatenation in this case) but in practice if it makes your SQL code easier write then it's worth considering. I can see that it would be easier to verify that 1.0.1.123 and 1.0.01.123 are duplicate values with each element parsed out. However, you must still ensure you have data integrity so make sure you are not missing the validation rule (CHECK constraint) that ensures Field 1 is indeed a concatenation of Fields 2 to 5 or the constraint that ensures each concatenations is unique. Oh, and in case it isn't obvious, you may want to review your use of field names, especially where the data element name 'Field 2' changes its meaning/pertinence depending on the table in which is appears. Jamie. -- |
#3
|
|||
|
|||
Work Breakdown structure and normalization
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Do I need help with normalization? | smitj2 | Database Design | 5 | June 4th, 2006 11:35 PM |
Parameter query with multiple check boxes | Aviator | Running & Setting Up Queries | 28 | May 1st, 2006 06:19 PM |
normalization question | Ian | Database Design | 7 | December 14th, 2005 06:21 PM |
Can't figure out table structure and normalization | Jonathan Brown | Database Design | 3 | June 7th, 2005 07:05 PM |
Table fields, normalization | LReber | New Users | 1 | December 30th, 2004 01:03 AM |