Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003
    Posts
    1

    Help with databasedesign.

    I'm pretty new to databasedesign, and are wondering how I should design my database:

    I have a code, example: 1209.8, where the first digit is a general location, the next digit specifies the location more accurate, and so on to the last digit.
    (1 = USA, 2 = California, 0 = Los Angeles, 9 = Hollywood, 8 = Hollywood Road)

    Should I put it all in one large table, should I split it up in some smaller tables or should I split it all up in different tables?

    The last solution would be something like this:

    Table Country:
    1 - USA
    2 - Canada
    3 - Norway
    .
    .

    and then for USA
    Table USA:
    1 - New York
    2 - California
    3 - Arizona
    .
    .
    and so on.

    Wouldn't this make extremely many tables? (Worst case 10^5 = 10000)

  2. #2
    Join Date
    Mar 2003
    Location
    PAKISTAN
    Posts
    4

    Re: Help with databasedesign.

    You can do this
    TABLE= Countries
    1- USA
    2- CANADA
    3- NORWAY

    TABLE= CITIES
    1-1-NEWYORK
    1-2-CALIFORNIA
    1-3-ARIZONA

    TABLE= LOCATION
    1-1-1 NEWYORK EAST
    1-1-2 NEWYOR WEST

    and so on

    by this you will have to make few tables.
    There is one more design you can make in which you
    will need only one table

    table= geography
    Country
    City
    Location
    Road
    now the records can be like this

    COUNTRY CITY LOCATION ROAD
    USA NEWYORK NEWYORK EAST NEW YORK EAST ROAD
    USA NEW YORK NEWYORK WEST NEW YORK WEST ROAD


    and so on



    Originally posted by RumCoke
    I'm pretty new to databasedesign, and are wondering how I should design my database:

    I have a code, example: 1209.8, where the first digit is a general location, the next digit specifies the location more accurate, and so on to the last digit.
    (1 = USA, 2 = California, 0 = Los Angeles, 9 = Hollywood, 8 = Hollywood Road)

    Should I put it all in one large table, should I split it up in some smaller tables or should I split it all up in different tables?

    The last solution would be something like this:

    Table Country:
    1 - USA
    2 - Canada
    3 - Norway
    .
    .

    and then for USA
    Table USA:
    1 - New York
    2 - California
    3 - Arizona
    .
    .
    and so on.

    Wouldn't this make extremely many tables? (Worst case 10^5 = 10000)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •