Avatar billede zeron1111 Nybegynder
13. februar 2003 - 23:14 Der er 8 kommentarer og
1 løsning

UK Mail

This question is (probably) mainly directed at Terry. Can you give me some pointers as to the databasedesign of a UK postcode table related to a customers table? I’m trying to make a db that registers customers in a shop in the UK.
I know about postcodes, areacodes (posttown+district,no?), counties, sectors and locations, but not how to put it all together in a postcode table (or even if it can be done). The danish system uses just (as you know, of course) a customer table with a postcode ref field related to a postcode table holding all legitimate postcodes and the cityname. But how does this look in the UK?
Any help at all would be much appreciated, because the logic of the system has me quite dazzled.

(I have all UK areacodes with all corresponding counties and towns/cities (27213), but not district and location designations. I also know that the relationship between counties and areacodes is complex).
Avatar billede sjap Praktikant
13. februar 2003 - 23:53 #1
Nu er mit navn ikke Terry, og har som sådan ikke tænkt mig at udfordre hans viden på dette område, men du kan faktisk finde nogen ganske udmærkede beskrivelser og postcode liste på følgende adresse

http://www.brainstorm.co.uk/utils/Welcome.html
Avatar billede sjap Praktikant
14. februar 2003 - 00:02 #2
Avatar billede zeron1111 Nybegynder
14. februar 2003 - 00:04 #3
Jeg har mange af mine data fra den side du nævner, men det er ikke nok til at forstå hvordan det hele skal skrues sammen. De fulde postcodes (som jeg kunne have brugt som primærnøgle) står der f.eks. ikke. Areacodes er ej heller bundet til blot enkelte byer eller counties, men går helt på tværs af disse, så dem kan jeg heller ikke anvende som PN.
Avatar billede sjap Praktikant
14. februar 2003 - 00:08 #4
Og så lige en sidste, hvor der er en ret fyldig beskrivelse (lige efter Germany).

http://iquebec.ifrance.com/rolf1/info/postal-codes.html
Avatar billede terry Ekspert
14. februar 2003 - 18:37 #5
will lget back as soon as I have something
Avatar billede terry Ekspert
15. februar 2003 - 15:10 #6
superjap, its over thirty years since I lived in the UK so maybe your knowledge on this area is better than mine :o)

www.royalmail.com does actually give all the answers I think, although it may not be too easy to find.
What is important though is that a FULL postal code will be accurate to within 15 addresses (average) in DK this isnt possible.
In DK you can manage with one table containing postnumber and town, but it will take one or more tables for the UK system.

Really I think it all depends one what you want to do. If you are just interested in registering FULL postcodes then you can manage with one table. When a new customer is added to the dB then the FULL postcode is checked against those existing and if its found the town can be displayed. If the number is NOT found then the Town must be added. In the end you will have a system much like the Danish but I would imagine that it will NOT be possible to enter a TOWN to find the postal code, this is because there will be more than one postal code for the same town. So you primary key is a FULL postal code.

I found this which MAY be of use:
What is a correct address? 
 
A correct address is made up of the following elements:-

3 High St      Number and Street Name 
Hedle End      Locality Name (if required) 
SOUTHAMPTON      Post Town
SO31 4NG      Postcode

(You do not need to include a County name if the Post Town and Postcode are used) 


What is a postcode? 
 
The postcode is essential for everything you send. Please make sure you use the full, up-to-date and correct postcode.
A postcode tells us how to route the mail. Each postcode pinpoints on average, 15 addresses.
A postcode is made up of two parts-see the example below of SO31 4NG:-

Outward Code e.g. SO31

SO= The postcode area. One or two alpha characters which identify the main office through which the mail will be processed. 
31= The postcode District. One or two characters usually numeric except in central London. These normally relate to areas covered by the Delivery Office. 

Inward Code e.g. 4NG

4= The Sector. A number that defines a neighbourhood within a district. 
NG= The Unit code. Two letters which identify the group of approximately 15 addresses.
Avatar billede zeron1111 Nybegynder
15. februar 2003 - 15:44 #7
Thank you for your advice (and Superjap too). My problem is that I understand how the system works but haven’t been able to find all the full postcodes, which means that I don’t have much to hold the “typed in postcode” up against. 
I only have all:
Areacodes = 121
Posttowns = 139 (Oops. These are posttowns apparently, not counties)
Towns = 27213

I can check against these then, but it would have been nice to have the last three numbers/letters. I guess I’ll do what you suggest and put the postcode in the customer table and more or less leave at that.
I actually have been looking high and low at www.royalmail.com, but perhaps I haven’t looked carefully enough, because I didn't find what I was looking for.
Avatar billede terry Ekspert
15. februar 2003 - 15:50 #8
I dont know exactly what it is you are making, but as long as your not creating many records a day then this solution is maybe the easiest. It saves you having to have ALL postcodes in the dB, only those which your using.

You put the postcode (foreign key) in the customer table and the TOWN in the PostCodeTown table along with the primary key which is postcode.
Avatar billede zeron1111 Nybegynder
15. februar 2003 - 15:52 #9
Got it. Thanx
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester