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<
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.