Hello All,
I come across a question and don't know how to integrate the followin into my tables.
This must be very common as it's seen/used everywhere on the Internet etc...
I need people to choose locations for customers, companies etc...
Let's say, my table tblCustomers needs to contain in which city/country/state people live.
3 columns:
- tblCountries with CountryID
- tblStates with StateID and link to countries fkCountryID
- tblCities with CityID and link to countries fkCountryID and link to states fkStateID
A country can be 'United States', so in this case a state is needed and a city within this state.
If a country is not the US, the customer only needs country and city.
First I thought to only put fkCityID in my customers table as for non-US, the country is known as well
through fkCountryID in tblCities. But... the city is not always known so only the
country will be provided.
So... do I need to put 3 fields in my customer table:
fkCountryID, fkStateID, fkCityID and see which ones are filled in ?
Do these 3 tables make sense or... ?
Does anybody did something similar before ? Any suggestions or tips about how this is done
so many times ???
Thanks sooo much.
Evelyne
I come across a question and don't know how to integrate the followin into my tables.
This must be very common as it's seen/used everywhere on the Internet etc...
I need people to choose locations for customers, companies etc...
Let's say, my table tblCustomers needs to contain in which city/country/state people live.
3 columns:
- tblCountries with CountryID
- tblStates with StateID and link to countries fkCountryID
- tblCities with CityID and link to countries fkCountryID and link to states fkStateID
A country can be 'United States', so in this case a state is needed and a city within this state.
If a country is not the US, the customer only needs country and city.
First I thought to only put fkCityID in my customers table as for non-US, the country is known as well
through fkCountryID in tblCities. But... the city is not always known so only the
country will be provided.
So... do I need to put 3 fields in my customer table:
fkCountryID, fkStateID, fkCityID and see which ones are filled in ?
Do these 3 tables make sense or... ?
Does anybody did something similar before ? Any suggestions or tips about how this is done
so many times ???
Thanks sooo much.
Evelyne