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 |
|
norty911
Starting Member
41 Posts |
Posted - 2008-10-02 : 07:26:03
|
| Hi guys,I have three tables: 1) A Motorcycle table which contains info like:Color of bikePrice of bikeTop Speed of bike..etb2) A Series table which contains the motorbike series:E.g. F series or G series3) A Model table which contains the bikes Model numberE.g. F650GS or F800GSI know that mutliple Models can belong to the same Series e.g:The F series can have : F650GS, F800GS etc.My question is, what would that table relationships be between these three tables?At the end of the day I want to pull a query that saysBlack Bike, $1000.00, F Series, F650GSThanks guys |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-10-02 : 07:27:58
|
http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx E 12°55'05.63"N 56°04'39.26" |
 |
|
|
norty911
Starting Member
41 Posts |
Posted - 2008-10-02 : 07:37:44
|
| Im confused?I know how to build the table relationships between Series and Model but how do build the relationships between that and the Motorcycle table?Thats all I need to know? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-02 : 07:44:55
|
| how are Model and series currently related? |
 |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-10-02 : 07:45:48
|
| you're confused....? if you don't even know what the relationship is between Model and Motorcycle, how could we know? it could be 1:1 it could be 1:many. it's a question of business logic and how the system was designed. with some proper sample data we could probably make a guess, but that's all it would beEm |
 |
|
|
norty911
Starting Member
41 Posts |
Posted - 2008-10-02 : 07:49:15
|
| They are joined by relationship tableIn other words I've go three tablesMODEL id modelName RELATIONSHIPmodelId_fkseriesId_fkSERIESidseriesNameHow do I link those three tables back to the Motorcycle table?(Thanks in advance ;) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-02 : 07:52:43
|
quote: Originally posted by norty911 They are joined by relationship tableIn other words I've go three tablesMODEL RELATIONSHIP SERIESid modelId_fk idmodelName seriesId_fk seriesNameHow do I link those three tables back to the Motorcycle table?(Thanks in advance ;)
then what you want is to have a unique valued column (identity) on relationship table and add it as a foreign key in Motorcycle relationship_fk. so each motorcycle will have correspond to relationship record which suggests its model & series. |
 |
|
|
norty911
Starting Member
41 Posts |
Posted - 2008-10-02 : 07:57:54
|
| Thank you! ;) |
 |
|
|
|
|
|