doujieluo5875 2017-07-25 17:10
浏览 11
已采纳

MYSQLI数据库设计/结构[关闭]

I don't have a coding question but more of a structure related one.

If I had a site that say for example allowed a user to sign up, login, and manage finances, or a family photobook or whatever.(the job that the front end is performing is irrelevant) If I have multiple users registering and creating there own accounts then what would be the correct way to store that data? I assume you would not have a single table with different users data together so would it be proper to create a single table for user logins then automatically create a new table exclusive to each new user that would then hold the data related to there personal login?

Take a online check book for example, I would have a table that manages user logins then during the registration process it would automatically create a table for that user to hold all the data entries for their own check book. is that correct? What if the data requires multiple tables to manage one particular users data?

Also does anyone have any good links on proper database structure I could check out? Not knowing correct terminology is hindering my searches.

Thanks in advance!

  • 写回答

1条回答 默认 最新

  • dongqieli4164 2017-07-25 17:17
    关注

    Do not create a table for each user, create one table that is keyed by the user's unique identifier and put all user's data into it. You can create one such table for each logical set of information however. E.g., a users table with user information, a posts table with blog posts made by the user, a friends table that links users together.

    Keep this in mind -- day-to-day operation of your application should never require changes to the database schema (like CREATE TABLE), only row manipulation operations (like INSERT and UPDATE.) First Normal Form is a good place to start reading up on the subject.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答