views:

311

answers:

5

Given that state information is implicit in the zip code aren't storing both of them some violaiton of third normal form? Can or should you simply combine them into one field?

+10  A: 

According to this post, there are a few zip codes that cross state boundaries. So no, it is not a violation of 3NF.

Actually, there are a few rare cases where a ZIP Code crosses state boundaries. Usually it is due to access problems, such as being on a military base or due to constraints of the transporation network.

One such case is Protem, Missouri (ZIP Code 65733). Some of the Arkansas roads north of Bull Shoals Lake can best be accessed by the Protem delivery unit rather than an Arkansas post office. Some examples of such roads include Ann Street, Kalijah Road, McBride Road, Red Oak Lane, and Vance Road on Highway Carrier Route H002 in ZIP Code 65733. McBride Road actually crosses across the state boundary. If you look at the road network in an online mapping program, you can see that a rural carrier from say, nearby Diamond City, AR (ZIP code 72644), on the south side of Bull Shoals Lake, would need to drive several miles to be able to access the roads listed above.

For another example, Fort Campbell, Kentucky (ZIP Code 42223) also has some roads that exist within Tennessee.

Thilo
lol leave it to us to make even the most simple of things ungodly complex...
ojblass
Great link... thank you....
ojblass
+6  A: 

That statement isn't actually true in all geographical areas. Australia has a few sister cities that straddle state boundaries yet share the same postcode.

And 3NF, while incredibly useful, is not inviolable. I've sometimes reverted some table information back to 2NF for performance reasons.

paxdiablo
+1 for not advocating 3NF religiously. If there is no real concern that you get inconsistent data, and if the extra storage requirement for the redundant data is minimal (such as two bytes for the state code), do not normalize for normalization's sake. Being able to avoid a silly join is what you gain in the trade-off.
Thilo
Very well, ditto.
Alix Axel
A: 

Nope. There are some zip codes that cross state lines. See Wikipedia for some examples. Furthermore, normalization reduces redundancy, while addresses are actually fairly complicated things that are easy to get one component of wrong. Redundancy means that even if part of the address is wrong, there is a good chance that the mail will be able to get where its going.

I recall a time when a hiker from Europe stayed at my fraternity, and wanted to send a thank-you note. He did not understand American addresses or geography very well, so when he sent the note it was addressed to "<fraternity name> <not quite correct name of university> New England? USA". The mail actually got there, amazingly enough.

Redundancy in addresses can be a very good thing, and you generally shouldn't assume more about an address than you need to. For instance, some people don't have a street number; you put "general delivery", and the mailman is expect to know where the letter goes (or you can pick it up at the post office if he doesn't).

Brian Campbell
A: 

There is a different issue. You might want to make a difference between the data that was entered (which could be conflicting) and the conclusion you make from that.

Stephan Eggermont
A: 

Although ZIP codes might include addresses in more than one state, any mailing address standardized to USPS requirements by CASS software will end up with with a ZIP and state abbreviation such that every ZIP implies one and only one state, so the state is indeed redundant to the ZIP. See http://semaphorecorp.com for cheap CASS tools.

However, keeping two bytes of state abbreviation in the same record as the ZIP is simple, small, and fast. Segregating the state abbreviation into a separate lookup table unnecessarily adds complexity, space, and delays.

joe snyder