--- Jochem van Dieten <[EMAIL PROTECTED]> wrote: > David Blomstrom wrote: > > --- Jochem van Dieten <[EMAIL PROTECTED]> > wrote: > > > > "So how are you going to put Russia in both Asia > and > > Europe? How are you going to put Turkey in both > Asia > > and Europe? Egypt in Africa and Asia?" > > > > Egypt is in Africa, not Asia. > > Usually the part on the eastern side of the Suez > canal is > regarded as being part of the Middle East, hence > Asia. > > > > Russia and Turkey pose a > > problem, but if I can't figure it out, I'll just > > choose Europe OR Asia, then explain it in the > text. > > How about having just 3 tables: > > AreaTypes: > AreatypeID AreaType > 1 Continent > 2 Country > 3 City > 4 etc. > > Areas: > AreaID Area AreaTypeID > 1 Europe 1 > 2 France 2 > 3 Germany 2 > 4 Paris 3 > > AreaHierargy: > AreaID ParentID > 1 NULL > 2 1 > 3 1 > 4 2 > > Just walk the tree :)
Wow, that looks like a great scheme. I'll probably replace the numerals with ISO codes, FIPS codes and letter abbreviations, so your last table might look something like this: AreaHierargy: AreaID ParentID eu eurasia fr eu gm eu fr001 fr And then when I want to add data, like the names of capital cities, population, etc. I can just create additional tables and join them to these using shared ID fields, right? Thanks; I think I'll give this a try right now. __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]