MySQL Tables column inheritance dynamically

十年热恋 提交于 2019-12-20 05:47:16

问题


I don't know if this is possible but I'll explain what I need.

What I've got: - Table1: A users table - Table2: A table which contains items definitions - Table3: A table which stores for each user, amounts of items (defined in previous table)

With this tables structure, what I need to achieve is that when I add a row in Table2 (items definitions), automatically Table3 (users items) updates according to Table2 columns.

Example:

If I deleted a row in Table2, this would be the action:

What's the best way to do this?

来源:https://stackoverflow.com/questions/33837528/mysql-tables-column-inheritance-dynamically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!