Suppose I have database tables called Customers, Countries, States and Cities. An individual customer would have a CityID field, which links to the Cities table. Each city would have a StateID field, which links to the states table, and similar for countries.
This is all straightforward when we know the full address of the customer, but sometimes we only have their country, and sometimes only the sate. We don't always have the city.
How do we handle this? We want to be able to save the country, but can't if we don't know the city.
We could add StateID and CountryID fields to the customers table, but that smells like poor design, and could lead to inconsistent data.
Anyone any suggestions? I'm sure this is a pretty standard question, but I can't find a good answer to it.
P.S. In answer to Jaffar's comment below, the reason for doing this is that we need to do some analysis of where our customers are distributed. The client sells hugely expensive medical scanners to hospital groups, and doesn't always know which site will take the scanner when it's ordered. Therefore, we need to be able to specify as much info as we can, which may only be the country, may be the state, or may be the city.
We currently only need to do this for the US, but would prefer to provide a flexible approach in case the client wants to expand the analysis to other countries.