SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Location
    Hertfordshire
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Advice on Setting up Address Database Please

    Hi

    (Before i start i feel obliged to point out my Noobie status so not to shock! )

    As part of a larger poject i need to set up an name and address database.

    Before i start i would very much appreciate some comments on the format of the primarry tables.

    For example if i set first_name as VARCHAR(15), last_name VARCHAR(30) - this seems ok, but from experience what would people suggest as being realistic for the Address part..

    Do i need several fields to allow for each line of the address:

    MyHome
    MyStreet
    MyStreet2 (optional)
    MyTown
    MyCounty / State
    MyPostCode

    I have found several different stratergies for this such as VARCHAR with no max length.... is this a good idea?

    Aslo UK post codes - i guess a VARCHAR of max 10 would suffice, but does any one know of an imput mask / regular expression to ensure valid imput?

    Any thoughts or directions to a good tutorual would be most greatfull.

    GreenBoy

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    VARCHAR must have a length, and i would use something large enough to hold whatever is reasonable

    i have known people whose surname is longer than 30 characters -- why not use 50, or even 100? it's not as if there will be any space wasted
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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