MySQL Forums
Forum List  »  Newbie

good table structure?
Posted by: waiyung.iu
Date: May 20, 2005 07:03AM

I have a COUNTRIES table that holds all the countries' names. The table structure lists in the following:

country_id tinyint(8) UNSIGNED auto_increment
country varchar(50)

I have a another table called INFO table, which store a person's current demographic data.
In this table, I have following two rows:

nationality tinyint(8)
current_Location tinyint(8)

Both rows will point to the country_id. Basically they are foreign keys coming from COUNTRIES
table , but with different /same value. My question is that I found this table structure is very
difficult to query, especailly if you want to get nationality and current_loc at the same time.
You need to do a self join first, then join with COUNTRIES to get those two values. And when
you consider multiple joins further, it will be nightmare.

Is any other good way to handle this situation? Is tthere any way that I could change table
structure?

Thanks!

Options: ReplyQuote


Subject
Written By
Posted
good table structure?
May 20, 2005 07:03AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.