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 |
|
jason_lakewhitney
Starting Member
5 Posts |
Posted - 2007-02-22 : 14:30:23
|
| I will be describing an electrical system. Option(1) is proposed by someone else, and I proposed option(2). I am using the term 'node' as a point on a electrical bus and 'devices' repersents switches or breakers...Two option:(1)(a)1:M<---(b)M:M--->(c)M:1(2)(a)1:M<===(b)1:M<---(c)1:M(1)Table (a)&(c) have a many to many relationship. Table (b) is used to make this relationship.This is to say that many nodes can connect to many devices. This does not show how different devices might relate to each other nor does it give connectivity. To set up a query to get the rating of a bus can be done with some work.(2)Table (a)&(b) have a double one to many and table, meaning the PK of (a) is a FK in (b) twice.Table (b)&(c) have a one to many.The (a)&(b) relationship creates a 'section'(Point A to Point B). Then from that a device in table (c) sits on a specific 'section' in which that 'section' is tied to only two nodes (or records in table (a)). This does give connectivity to the devices and getting the rating of a bus would be much easier.Option(2) is my opion if one of yall is able to understand what I am presenting. Can I get some feed back on both options. Don't worry I do not get offened by constructive replies. I see how option(1) works but I believe option(2) is more effectent. |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2007-02-22 : 17:11:32
|
| Let me see if I understand what you are getting at...A Node exists on a Segment. And a Segment consists of 2 Devices (switches or breakers).If that is the case, then my only question is about a Segment: Can the 2 Devices be any combination of switches and breakers? Or is it always 1 switch and 1 breaker?If it can be any combination of devices then I think it makes sense to have 2 foreign keys to a Device table. (with a constraint that the two keys cannot be the same)-Ryan |
 |
|
|
|
|
|