Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database design suggestion 4

Status
Not open for further replies.

w11z

Programmer
Mar 26, 2001
40
CA
Hi everyone, What would be the best way of representing this relation between Countries, States and Cities.

1-

tblCountries
countID(PK), countName

tblCountries_States
countID, stateID

tblStates
stateID(PK), stateName

tblStates_Cities
stateID, cityID

tblCities
cityID(PK), cityName

OR is this way better

2-

tblCountries
countID(PK), countName

tblSates
stateID(PK), stateName, countID(FK)

tblCities
cityID(PK), cityName, stateID(FK), countID(FK)

Why would one design be preferred to the other?

Thanks
 
Although this is not the Data Warehouse forum, remember that denormalization of country, postal code, city, address, etc into the customer record is a DW performance technique. However, denormalization should be a conscious effort, not an excuse for a poor design. Perform data modeling first, then denormalize (as a later part of the design process).

-------------------------
The trouble with doing something right the first time is that nobody appreciates how difficult it was - Steven Wright
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top