I'm still a novice to databases, normalization, etc, and I might need some help. Enclosed here is a portion of my database structure, and I'm thinking that my approach is a bad idea. Here, our country can be classified into different provinces, and all cities/towns are under a specific province, and a barangay (the closest Layman's term is District, I guess). So if all places, where ever you may be in our country, you must have that certain barangay, city/town, and province. What I did is I used Foreign Keys to refer to tables barangay, city/town, province. Is this a bad idea?
How different is it if I created a tblCustomer_Address
to separate Country_ID: Int FK
, Province_ID: Int FK
, CityTown_ID: Int FK
, Baranggay_ID: Int FK
from tblCustomer
?
Thanks!
tblCustomer(
Customer_Id: Int PK
Customer_FName: String
Customer_MName: String
Customer_LName: String
Country_ID: Int FK
Province_ID: Int FK
CityTown_ID: Int FK
Baranggay_ID: Int FK
Additional_Address_Details: String
)
tblCountry(
Country_Id: Int PK
Country_Name: String
)
tblProvince(
Province_Id: Int PK
Province_Name: String
)
tblCityTown(
CityTown_Id: Int PK
CityTown_Name: String
)
tblBarangay(
Barangay_Id: Int PK
Barangay_Name: String
)
* EDIT: By the way, I forgot to mention. A part of my project is report generation, so I what I had in mind is to keep track of the locations. So I thought of having separate tables for barangays, city/town, provinces, to make each and everyone unique.
` tags, either! – marc_s Jun 21 '12 at 08:42