dbTalk Databases Forums  

Distance between 2 cities

comp.databases comp.databases


Discuss Distance between 2 cities in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AK
 
Posts: n/a

Default Re: Distance between 2 cities - 08-25-2005 , 09:48 AM






have a PK on (city_from, city_to)


Reply With Quote
  #2  
Old   
Paul
 
Posts: n/a

Default Re: Distance between 2 cities - 08-25-2005 , 01:04 PM








Jack <hung93 (AT) msn (DOT) com> wrote:

Quote:
I want to record the flight distance between cities in ER model. But the flight distance from
city A to city B is different from distance B to A.

How can that be? Are you working on some sort of ATC system whereby
the routes between the cities varies depending on various parameters
involving "skyways"?

In any case, why is it necessary to postulate that there is a
difference (as might be the case between two towns connected by one
way streets?)?

Do any (in the case of flight paths) probably minor differences make
much of a difference (sorry about the pun) for the sake of any real
world business case - i.e is the percentage difference between cities
really important for what you are doing? More explanation is
necessary.


Quote:
How can i do this in
ER diagram ?I know Each city is unique .

Could you expand on your requirements please?



Paul...




--

plinehan __at__ yahoo __dot__ __com__

XP Pro, SP 2,

Oracle, 9.2.0.1.0 (Enterprise Ed.)
Interbase 6.0.1.0;

When asking database related questions, please give other posters
some clues, like operating system, version of db being used and DDL.
The exact text and/or number of error messages is useful (!= "it didn't work!").
Thanks.

Furthermore, as a courtesy to those who spend
time analysing and attempting to help, please
do not top post.


Reply With Quote
  #3  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: Distance between 2 cities - 08-25-2005 , 03:21 PM



On Thu, 25 Aug 2005 19:04:31 +0100, Paul <paul (AT) see (DOT) my.sig.com> wrote:

Quote:

Jack <hung93 (AT) msn (DOT) com> wrote:

I want to record the flight distance between cities in ER model. But the flight distance from
city A to city B is different from distance B to A.


How can that be? Are you working on some sort of ATC system whereby
the routes between the cities varies depending on various parameters
involving "skyways"?

In any case, why is it necessary to postulate that there is a
difference (as might be the case between two towns connected by one
way streets?)?
There could be a difference in travel *time* because of
prevailing winds.

Quote:
Do any (in the case of flight paths) probably minor differences make
much of a difference (sorry about the pun) for the sake of any real
world business case - i.e is the percentage difference between cities
really important for what you are doing? More explanation is
necessary.
Quite.

[snip]

Sincerely,

Gene Wirchenko



Reply With Quote
  #4  
Old   
.
 
Posts: n/a

Default Re: Distance between 2 cities - 08-25-2005 , 07:22 PM




"Paul" <paul (AT) see (DOT) my.sig.com> wrote

Quote:

Jack <hung93 (AT) msn (DOT) com> wrote:

I want to record the flight distance between cities in ER model. But the
flight distance from
city A to city B is different from distance B to A.


How can that be? Are you working on some sort of ATC system whereby
the routes between the cities varies depending on various parameters
involving "skyways"?

probably working with flight duration

Quote:
In any case, why is it necessary to postulate that there is a
difference (as might be the case between two towns connected by one
way streets?)?

Do any (in the case of flight paths) probably minor differences make
much of a difference (sorry about the pun) for the sake of any real
world business case - i.e is the percentage difference between cities
really important for what you are doing? More explanation is
necessary.

as an example Perth -> Sydney = ~4 hours but Sydney -> Perth = ~5 hours.
This is due to prevailing winds.
I would think that the airline would consider an extra hour of fuel and
flight time significant.

Quote:
How can i do this in
ER diagram ?I know Each city is unique .


Could you expand on your requirements please?



Paul...




--

plinehan __at__ yahoo __dot__ __com__

XP Pro, SP 2,

Oracle, 9.2.0.1.0 (Enterprise Ed.)
Interbase 6.0.1.0;

When asking database related questions, please give other posters
some clues, like operating system, version of db being used and DDL.
The exact text and/or number of error messages is useful (!= "it didn't
work!").
Thanks.

Furthermore, as a courtesy to those who spend
time analysing and attempting to help, please
do not top post.



Reply With Quote
  #5  
Old   
Jack
 
Posts: n/a

Default Distance between 2 cities - 08-26-2005 , 03:35 AM



I want to record the flight distance between cities in ER model. But the flight distance from
city A to city B is different from distance B to A. How can i do this in
ER diagram ?I know Each city is unique .

Thank you very much.

Reply With Quote
  #6  
Old   
Paul
 
Posts: n/a

Default Re: Distance between 2 cities - 08-26-2005 , 06:00 AM





Gene Wirchenko <genew (AT) ucantrade (DOT) com.NOTHERE> wrote:


Quote:
In any case, why is it necessary to postulate that there is a
difference (as might be the case between two towns connected by one
way streets?)?

There could be a difference in travel *time* because of
prevailing winds.

Good thinking - my father would be ashamed of me - he was a
meteorologist. However, aren't prevailing winds different at different
altitudes - jetstreams, and can't pilots go up or down to take
advantage of this?



Paul...


Quote:
Gene Wirchenko

--

plinehan __at__ yahoo __dot__ __com__

XP Pro, SP 2,

Oracle, 9.2.0.1.0 (Enterprise Ed.)
Interbase 6.0.1.0;

When asking database related questions, please give other posters
some clues, like operating system, version of db being used and DDL.
The exact text and/or number of error messages is useful (!= "it didn't work!").
Thanks.

Furthermore, as a courtesy to those who spend
time analysing and attempting to help, please
do not top post.


Reply With Quote
  #7  
Old   
Paul
 
Posts: n/a

Default Re: Distance between 2 cities - 08-26-2005 , 08:56 AM





Paul <paul (AT) see (DOT) my.sig.com> wrote:


Quote:
There could be a difference in travel *time* because of
prevailing winds.

Quote:
Good thinking - my father would be ashamed of me - he was a
meteorologist. However, aren't prevailing winds different at different
altitudes - jetstreams, and can't pilots go up or down to take
advantage of this?


Hmmm... thinking about this. Should the journey_duration be affected
by the earth's rotation - i.e. if you fly east to west (against the
earth's rotation) it will be shorter than if you fly west to east?


Paul...


Quote:
Gene Wirchenko

--

plinehan __at__ yahoo __dot__ __com__

XP Pro, SP 2,

Oracle, 9.2.0.1.0 (Enterprise Ed.)
Interbase 6.0.1.0;

When asking database related questions, please give other posters
some clues, like operating system, version of db being used and DDL.
The exact text and/or number of error messages is useful (!= "it didn't work!").
Thanks.

Furthermore, as a courtesy to those who spend
time analysing and attempting to help, please
do not top post.


Reply With Quote
  #8  
Old   
Jack
 
Posts: n/a

Default Re: Distance between 2 cities - 08-26-2005 , 01:46 PM



On Fri, 26 Aug 2005 00:35:45 -0800, Jack wrote:

Quote:
I want to record the flight distance between cities in ER model. But the flight distance from
city A to city B is different from distance B to A. How can i do this in
ER diagram ?I know Each city is unique .

Thank you very much.
Sorry for the confusion. I mean flight duration . Number of hours from A
to B is different from B to A . I try to use recursive relation ship but i
dont think it's right.



Reply With Quote
  #9  
Old   
.
 
Posts: n/a

Default Re: Distance between 2 cities - 08-26-2005 , 07:00 PM




"Paul" <paul (AT) see (DOT) my.sig.com> wrote

Quote:

Paul <paul (AT) see (DOT) my.sig.com> wrote:


There could be a difference in travel *time* because of
prevailing winds.


Good thinking - my father would be ashamed of me - he was a
meteorologist. However, aren't prevailing winds different at different
altitudes - jetstreams, and can't pilots go up or down to take
advantage of this?



Hmmm... thinking about this. Should the journey_duration be affected
by the earth's rotation - i.e. if you fly east to west (against the
earth's rotation) it will be shorter than if you fly west to east?

I don't think so.

If you were in an air balloon, would you see the earth moving due to
rotation below you? No, you wouldn't, because you are moving with the same
velocity and direction as the earth when you leave it, so even though it is
rotating very fast, it appears stationary to you due to your relative
velocity. Try this, while a passenger in a car or bus etc, throw a ball up
and catch it with the same hand. Does the ball fly to the rear of the
vehicle? No. Why? because it is also travelling at whatever speed you are so
it appears stationary to you (people outside the bus see a different view of
course)


Quote:
Paul...


Gene Wirchenko


--

plinehan __at__ yahoo __dot__ __com__

XP Pro, SP 2,

Oracle, 9.2.0.1.0 (Enterprise Ed.)
Interbase 6.0.1.0;

When asking database related questions, please give other posters
some clues, like operating system, version of db being used and DDL.
The exact text and/or number of error messages is useful (!= "it didn't
work!").
Thanks.

Furthermore, as a courtesy to those who spend
time analysing and attempting to help, please
do not top post.



Reply With Quote
  #10  
Old   
Ed Prochak
 
Posts: n/a

Default Re: Distance between 2 cities - 08-29-2005 , 01:41 PM




Jack wrote:
Quote:
On Fri, 26 Aug 2005 00:35:45 -0800, Jack wrote:

I want to record the flight distance between cities in ER model. But the flight distance from
city A to city B is different from distance B to A. How can i do this in
ER diagram ?I know Each city is unique .

Thank you very much.
Sorry for the confusion. I mean flight duration . Number of hours from A
to B is different from B to A . I try to use recursive relation ship but i
dont think it's right.
Why? Do you not like the table:
city_from,
city_to,
expected_flight_time
PK city_from, city_to
??



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.