Is this the right way to organize my database tables? -


So I'm creating a website that allows users to create a contact list. So their users are the list of users, and there are contacts in the list. I think I need 3 tables for this, but I want to make sure.

The curriculum will be hosted by a user, and then a "list of lists" table containing the user name and list name, along with the primary key as well as the complete list of whatever we want to engage with lists . Finally, for a lack of a better word, the user name / list name will be re-listed in the list table, then contact ID and notes and as such the user attaches that contact to that specific list.

I hope this is a clear explanation. For some reason I feel uncertain about this arrangement. For one thing if the website becomes popular then the list table can increase in billions rows. And it also sounds a little weird that the information of all the information is jumbled all in the same table. I think I can make different tables for each user and even for each list, but it seems like a bad idea for other reasons.

My DB statement assumes that I can use the foreign key on my table, in fact there is not an option. If I could not find the Inodb Tables enabled then maybe I changed the list of compound keys. I will use the ID for Maybe I should do it anyway?

You do not want to create a table per user, this is your worst nightmare beneath the road I Would have gone for some:

  user table ---------- user_id - integer - indexed user name - varkar [8] first_name - varkar [30] last_name - varChar [40] List table ----------- List_ID - Integer - Indexed user_id - Integer - Indexed list_name - Excl. [30] ] List_content table -------------- list_ID - integer - indexed contact_id - [whatever is the data type in the current contact table] User.User_ID = List.User_ID List.List_ID = List_Contact.List_ID List_Contact.Contact_ID [Linking to existing contact table]  

If you create some of the record sets in caching, then you will not have much of a performance problem even if you are in the database Get too many records. After all, all users will not be on the system at once.

Edit: The design has been changed to fit the existing contact table.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -