mattyvx Posted January 12, 2010 Share Posted January 12, 2010 Hi, I was wondering if you could shed some light on something for me; I want to know what the most efficient database structure would be for the following. I have a member table, ----------------------------- ID | Company | Price | About a Cities table ---------------------------- CityID | City and a Member_to_Cities table. ID | CityID My site currently works by showing member details for a specfic City. Now my site has grown I want to add an "Areas" table into the mixer. So users can select memebers from a City or an Area of a city. One member can be registered to many Cities. One member can be registered to many Areas. One city can have many Areas. How would you guys go about this? Should I add two more tables...? Areas ------------- AreaID | CityID | Area Members_to_Areas ------------------------ AreaID | ID Thanks! Link to comment https://forums.phpfreaks.com/topic/188233-normalised-efficient-database/ Share on other sites More sharing options...
ignace Posted January 12, 2010 Share Posted January 12, 2010 Yeah however I would remove Member_to_Cities as Member_to_Areas allows you to retrieve the city. If you are unsure on your db structure you can always draw a ERD to verify all relations are correct or needs adjusting. http://en.wikipedia.org/wiki/Entity-relationship_model Link to comment https://forums.phpfreaks.com/topic/188233-normalised-efficient-database/#findComment-993809 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.