Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
vk59
Starting Member
38 Posts |
Posted - 2005-03-07 : 07:14:14
|
| Hi, This is a design Issue. There are 3 tables namely tbl_State, tbl_Dept & tbl_DeptState(Mapping between tbl_State and tbl_Dept)In the tbl_state table I will have list of all the States availableIn th tbl_Dept table I will have list of all the Depts availableIn tbl_DeptState table I have below columnsDeptStateId -->Int -->PK-->Not NullDeptId -->Int -->FK-->NULLStateId -->Int -->FK--NULLAt any point of time only DeptId or StateId is null not the both.My Concern is, Can I store the data in the tbl_DeptState in such a way that if DeptId is null then it applies to all States and Similarly If StateId is null then it applies to all the depts.Please let me know whether I am violating any normalization rules and whether my approach is right.Thanks In AdvanceVk59` |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-03-07 : 10:26:31
|
| Typical design for an association table would be to not allow nulls for the association columns. Unless we're talking millions of records here, I'd probably explicitly load all deptIDs for "all" states and all StateIDs for "all" deptartments. That would make the queries simple and efficient.Be One with the OptimizerTG |
 |
|
|
|
|
|