|
Regarding a difficult problem of student status management, how to design the table structure?
I have a table that stores different class information. At the same time, each class has its own schedule (once the class is added, the start and end dates of this class are fixed), which is used to register the names of each student, but I find this table is very difficult to design. Is it better to design the attributes of the table as dates, or use the names of students as the attributes (the number of students may be added at any time)? This design seems to involve a problem of dynamically generating attributes, which is more troublesome. However, if you use dates as attributes, you also need to dynamically generate attributes (such as automatically generating each date 2016.12.1-2017.1.30 as an attribute).
In comparison, the latter method is better. Because dates are attributes and student names are content, it's more intuitive. But in this case, how to count the attendance rate of a student (because it is horizontal statistics). It is always impossible to write "select sum (attribute December 1 + attribute December 2 + ... + attribute January 29 + attribute January 30) as attendance from computer class
And regardless of the above methods, a separate table needs to be generated for each class, which in the past can hardly be managed. How to unify this information into a table? It is best to generate only one table in total.
I think this is a super difficult problem, please give me a lot of advice, thank you very much! !! |
|