0
votes

I need to create 2 tables rosters and records, whereby each roster has many records. A roster is based on class and there is maximum 1 roster for each class per day. A record can have many students.

I wonder that this master-detail relationship design is effective? My friend suggests that everything could be done in record table, since we want to display a roster of all the students in a class in a specific day. So in the master-detail approach, it takes query on 2 tables to accomplish the task, in contrast, it take only 1 query if there is only one record table.
Please advise.

1

1 Answers

0
votes

If you have attributes of ROSTER that you need to track over and above a primary key value, then database normalization rules require you to split out the ROSTER table. Of course, you can always choose to denormalize, but that decision must be made with your eyes wide open.

If you don't have columns for ROSTER other than a key, then your friend is right. Otherwise you should remind your friend that just because something could be done, doesn't mean it should be done.