I would like to set up a MySql database that will
store distance information for a milage lookup
program.  The user will enter the origin city and the
destination city for some predefined trips.  Then the
query will need to return the milage broken down by
state.  For example, for an origin city in NJ and a
destination city in OH, the program would need to
return how many miles were traveled within NJ, PA, and
OH.

It would be very inefficient to use one large table
with columns for each state in the USA because most of
them would be empty.

A two table approach would use a primary table to
store the origin, destination, and a unique reference
key.  While the secondary table would hold the
reference key as a foreign key and a record for each
state name and mileage.

If anyone has had a similar design challenge I would
appreciate hearing any comments you might have.

Thanks -- Michael


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to