Oracle FAQ Your Portal to the Oracle Knowledge Grid
 HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Fun Challenge #3

# Re: SQL Fun Challenge #3

From: Tony <andrewst_at_onetel.net.uk>
Date: 12 Mar 2004 03:00:32 -0800

Daniel Morgan <damorgan_at_x.washington.edu> wrote in message news:<1079077451.572264_at_yasure>...
> Gave this one to my students tonight.
>
> There are two solutions ... one easy and one that requires coding
> a function. Can you find them both?
>
> "Train 1" leaves station A heading east at 10:00am, "Train 2" leaves
> station B heading west at the same time. The two trains are moving
> towards each other on the same track and are 114 miles apart.
>
> The trains move at a constant 50 miles per hour. There is a bird perched
> on "Train 1". The bird begins to fly east as soon as "Train 1" begins
> to move. The bird flys at a constant 20 miles per hour and flies back
> and forth between "Train 1" and "Train 2" as the trains approach each
> other. The bird has perfect recoil (it spends 0 time perched on either
> train and experiences no acceleration and no deceleration). How many
> miles does the bird fly before the trains collide?
>
> And since my students got this first: Yes the bird is dimensionless.

I'm confused: is this bird flying at 20mph relative to Train 1 (i.e. 70mph relative to the ground), or 20mph relative to the ground - in which case it will never catch up with Train 1 or 2 before the collision? My limited knowledge of birds' abilities suggests 20mph relative to the ground.

The trains will collide after 114/100 hours, so the bird will have flown 20*1.14 = 22.8 miles

In SQL:

create table facts
( train1_speed number default 50

```, train2_speed number default 50
, bird_speed number default 20
, station_distance number default 114
```

);

select bird_speed * station_distance / (train_speed1 + train_speed2) from facts; Received on Fri Mar 12 2004 - 05:00:32 CST

Original text of this message

 HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US