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! Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/188233-normalised-efficient-database/#findComment-993809 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.