What is the best way to optimize schema for capturing attendance data

前端 未结 4 648
借酒劲吻你
借酒劲吻你 2021-01-14 13:59

We have a sports training camp which is regularly attended by various teams in the city. We have a session per day spanning 2 hrs(9-11 AM) and the time slots could vary for

4条回答
  •  北恋
    北恋 (楼主)
    2021-01-14 14:22

    You should ask yourself why you would do that.

    There are some possibilities, but it is likely that your database schema won't be fully normalized.

    So first of all: what do you want to achieve and what are the reasons for that?

    Some possibilities:

    • Some DBMS provide the ability to create a user-defined type
    • You could use a bitwise approach (in mysql the easiest way for this is using the SET datatype)

    But again: what is your current problem, since finding out the number of days someone was present is nothing more than joining the appropriate tables, and aggregate with a count function

提交回复
热议问题