4 ms·
Because a city/region/state can be uniquely identified with a postal code (hell, in Ireland, the entire address is encapsulated in the postal code), but the rev
by sgarland 1y ago
Because a city/region/state can be uniquely identified with a postal code (hell, in Ireland, the entire address is encapsulated in the postal code), but the reverse is not true.
At scale, repeated low-cardinality columns matter a great deal.
- bdangubic 1y agosaying zipcodes uniquely identify city/state/region is like saying John uniquely identifies a human :)
- virissimo 1y agoThere are ZIP codes that overlap a city and also an unincorporated area. Furthermore, there are zip codes that overlap different states. A data model that renders these unrepresentable may come back to bite you.
- pbnjay 1y agoFYI this is not true in the US. Zip codes identify postal routes not locations
- lucyjojo 1y agothese kinds of things are almost never true in the real world.
- sgarland 1y agoEDIT: TIL that there are cross-state ZIP codes.
- Breza 1y agoThis assumption got me in trouble as a junior analyst years ago. I was asked to analyze our customer base and wrote something like the below. Management congratulated me on finding thousands more customers than we'd ever had before. SELECT zipcode.rural_urban_code, COUNT(*) AS n_customer FROM customer INNER JOIN zipcode USING(zipcode) GROUP BY 1;