Click here to Skip to main content
15,867,968 members
Home / Discussions / Database
   

Database

 
AnswerRe: how to combine column values Pin
Hesham Amin22-Feb-07 10:08
Hesham Amin22-Feb-07 10:08 
AnswerRe: how to combine column values Pin
tvfoto22-Feb-07 12:02
tvfoto22-Feb-07 12:02 
GeneralRe: how to combine column values Pin
tvfoto23-Feb-07 3:51
tvfoto23-Feb-07 3:51 
QuestionMany : Many Pin
lost in transition 22-Feb-07 7:05
lost in transition 22-Feb-07 7:05 
AnswerRe: Many : Many Pin
Hesham Amin22-Feb-07 9:55
Hesham Amin22-Feb-07 9:55 
GeneralRe: Many : Many Pin
lost in transition 22-Feb-07 11:34
lost in transition 22-Feb-07 11:34 
GeneralRe: Many : Many Pin
Colin Angus Mackay22-Feb-07 13:23
Colin Angus Mackay22-Feb-07 13:23 
AnswerRe: Many : Many Pin
Colin Angus Mackay22-Feb-07 13:20
Colin Angus Mackay22-Feb-07 13:20 
Okay - I'm not familiar with nodes and devices in an electrical system. However option one looks like it describes a true many-to-many relationship. i.e. one node connects to many devices, one device connects to many nodes, therefore many devices connect to many nodes.

I just want to clarify what you are describing

(1) Node Table:
PK: NodeId

(3) Device Table:
PK: DeviceId

(2) Intermediate Table:
PK: NodeId, DeviceId


jason_lakewhitney wrote:
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.


How devices relate to each other is a different relationship. You can set up that relationship too.

If it is heirarchical then the Device table will contain a ParentDeviceId column as a foreign key that links to another row. If you only ever need to get the immediate parent or child this is quite efficient. If you need to get all children then you need to set up a separate table to denormalise the relationship. This adds duplicate information in a more efficient format for the queries you will run.

If Devices relate in a many-to-many way, then you can set up another intermediate table that links the two devices together.

Does this help?


GeneralRe: Many : Many Pin
lost in transition 23-Feb-07 3:08
lost in transition 23-Feb-07 3:08 
AnswerRe: Many : Many Pin
Marcus J. Smith23-Feb-07 3:52
professionalMarcus J. Smith23-Feb-07 3:52 
QuestionGETDATE Pin
Sam Heller22-Feb-07 5:52
Sam Heller22-Feb-07 5:52 
AnswerRe: GETDATE Pin
Colin Angus Mackay22-Feb-07 5:59
Colin Angus Mackay22-Feb-07 5:59 
GeneralRe: GETDATE Pin
Sam Heller22-Feb-07 8:28
Sam Heller22-Feb-07 8:28 
GeneralRe: GETDATE Pin
Colin Angus Mackay22-Feb-07 11:31
Colin Angus Mackay22-Feb-07 11:31 
QuestionDynamic SQL Error Pin
Sam Heller22-Feb-07 5:08
Sam Heller22-Feb-07 5:08 
AnswerRe: Dynamic SQL Error Pin
Colin Angus Mackay22-Feb-07 5:24
Colin Angus Mackay22-Feb-07 5:24 
QuestionRe: Dynamic SQL Error Pin
andyharman22-Feb-07 5:28
professionalandyharman22-Feb-07 5:28 
AnswerRe: Dynamic SQL Error Pin
Sam Heller22-Feb-07 5:49
Sam Heller22-Feb-07 5:49 
GeneralRe: Dynamic SQL Error Pin
andyharman22-Feb-07 6:54
professionalandyharman22-Feb-07 6:54 
QuestionHow to update using cursors? Pin
devboycpp21-Feb-07 23:12
devboycpp21-Feb-07 23:12 
AnswerRe: How to update using cursors? Pin
andyharman22-Feb-07 1:11
professionalandyharman22-Feb-07 1:11 
QuestionSQL Server 2005 deployment Pin
mirano21-Feb-07 22:46
mirano21-Feb-07 22:46 
QuestionMulti-byte characters in MSDE Pin
ChandraRam21-Feb-07 22:10
ChandraRam21-Feb-07 22:10 
Questiontrim command on sql Pin
firestoper21-Feb-07 20:22
firestoper21-Feb-07 20:22 
AnswerRe: trim command on sql Pin
Harini N K21-Feb-07 21:23
Harini N K21-Feb-07 21:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.