Difference between two table structure

后端 未结 3 659

I am very confuse about the two structure. What are the advantage and disadvantage of this two table? Which one is better and why?

TABLE1<

3条回答
  •  温柔的废话
    2020-11-30 14:53

    The table with columns id, name, age, birthdate, address is what you use when you know before deployment, what information to store about an entity.

    The table with columns id, col_name, col_value can be used if you only know after deployment, what information to store about an entity (for example if non-technical people should be able to define fields that they whish to capture). It is less efficient, but lets you define new fields without changing the database schema.

提交回复
热议问题