Database Design

Hi Ppl,

What is the best way to insert this chart(it's data) in database.

NAPIER

8TE AUTE

105NORSEWOOD

15105DANNEVIRKE

1815105WOODVILLE

201815105PALMERSTON NORTH

This chart represents a fare from one city to another. I need to store these fares in a database. What I have done now is created 3 fields in db i.e "from city", "to city" and "fare". And inserted fare from each city to other.

Please suggest me what is the best way to do it.

Thanks in advance.

[529 byte] By [amgandhia] at [2007-9-28 3:50:48]
# 1

Depends on the scope.

If this is a very small project then that works. If it is part of something bigger or it will get bigger then I would sperate "town" from "fare". One table contains names and the other contains keys to the table name. At the very least that means that you won't have different names for the same town showing up.

jschella at 2007-7-7 23:23:02 > top of Java-index,Other Topics,Patterns & OO Design...