John Munyan wrote: > I have a question about how a relationship would be best modeled in SQL. > Currently I have a hiking website, which hosts trail reviews. People can add > their own comments which are associated with the hike. > > For instance maybe I hiked snow lake on 12/1/05 and also 6/1/05. However, > the user review gets associated with the instance of the hike either on > 12/1/05. or 6/1/05. I want to combine these reviews so that they are > associated with both. I think a group ID could be assigned so this could be > accomplished.
Hmm.. wouldn't just querying to figure out if there is another review from the same user.. for a same trail.. take care of that.. am I missing something here.. > However... > > The real problem however is how to model something like this where one hike > is a subset or superset of another. Take for instance this example. > > TrailHead---3miles--Snowlake----2miles----Gemlake---1mile---WrightMountain. > > I would like the Snow lake reviews to be shown when either GemLake is viewed > or Wright Mountain. However, I wouldn't want reviews for Gem Lake when the > user is only intending to go to Snowlake. Thus the problem is how one would > handle this superset/subset association of reviews. > > If anyone has any thoughts about how this would be handled I would be > grateful for the advice. Simplest thing that comes to my mind is to create a another table.. which holds... review relationship between the trails.. snowLake : gemlake : snowLake,trailHead wrightMountain : snowLake trailHead : gemLake -- Umer Farooq Octadyne Systems +1 (519) 489-1119 voice +1 (519) 635-2795 mobile +1 (530) 326-3586 fax WEB SOLUTIONS FOR NON-PROFIT ORGANIZATION: http://www.Non-ProfitSites.biz WARNING: ------------------------------- The information contained in this document and attachments is confidential and intended only for the person(s) named above. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution, or any other use of the information is strictly prohibited. If you have received this document by mistake, please notify the sender immediately and destroy this document and attachments without making any copy of any kind. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193139 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54