Recently in learning database design suddenly be conscious of the understanding of some ideas, horizontal design, vertical design, this is probably to meet the first few paradigms I don't quite understand, but I want to summarize some experience in my own way.
The total well-known data table is a ' row ' and ' column ' composition, then we in the design to take into account the ' ranks ' of the data, the first is not to meet business needs, the second can be extended conveniently, the third can let the program write
Simpler, so this is a problem, it's also a design, the following example:
A piece of data about the student's elective grade:
--------------------------------------------------This is the traditional way of horizontal design
-------------------------------------------------It's a longitudinal design.
OK, suddenly feel that no matter how you want to add your elective, I am not afraid of you, but not that vertical design is invincible
Advantages and disadvantages of transverse design
Li: 1, preselection set up the required columns, easy to operate the database
Disadvantages: 1, not easy to expand, easy redundancy
Advantages and disadvantages of longitudinal design
Li: 1, easy to expand, good elasticity, follow the database design of the XX paradigm (as for the first few, I really do not remember)
Disadvantages: 1, lost control of the data, that is, it is difficult to maintain the standardization of data, if my program is not standardized optional in the elective column to join the ' cooking skills class ', then as I set a good technical school application scenario, this data is the wrong data
2, to manage and operate the longitudinal table is very difficult
In short, in the database design can not blindly pursue the longitudinal design, good elasticity, expand Well, he will be on the database as an unnecessary operation
In the design should pursue the balance, the necessity
Above for personal opinion, the wrong place wants to Haihan and correct.