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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2000-08-24 : 08:28:02
|
| Vivin writes "I have 3 tables that are:CITY with attributescityid(pk)citynmaeairportnamecitypopCLIMATE which has attributesmonth (pk)cityid (pk,fk)temperaturehumidityprecipitationDISTANCEdistancetraveltime* For this DISTANCE table, I need to get 2 Primary keys and 2 foreign keys from CITY table.My tables should be like this:*CITY*CITYID---CITYNAME----AIRPORTNAME------CITYPOP1000-----Amsterdam-----Amsterdam-----------50000002000-----Sydney----------KingsFord Smith----40000003000-----Tokyo----------Tokyo Airport--------7000000*DISTANCE*CITYID(1) CITYID(2)---DISTANCE--------TRAVELTIME1000-----2000-----------3000 km-------------25 hours(means from Amsterdam-Tokyo is 3000kms and travel time 25 hours)1000-----3000----------2000 km--------------20 hours2000-----3000----------1500 km--------------15 hoursHow do I do this kind of question:Which city is the farthest from Amsterdam and how long does it take to travel there?" |
|
|
|
|
|