Database design affected by UI needs: Should I make an extra field or a new relation?
I have this relation:
1 Incident Report has N Documents. The Incident Report could have a field like PupilName backed by a PupilID.
OR
I could change the design to:
1 Pupil has N Incident Reports etc...
My concern is that I do not like the extra table because in my GUI I used a sim开发者_运维百科ple grouped
DataGrid for the Incident Reports. When I have now still a Pupil Entity just to display the
PupilsName in the grouped Header...and the Incident Reports below in the Datarow. Of course
that would not be possible as I can not display a 1:N relation in a DataGrid!
What would you do?
Lisa, I see no design problems in the question.
Pupil IncidentReport Document
+---------+ +------------------+ +------------------+
| PupilID | | IncidentReportID | | DocumentID |
+---------+ +------------------+ +------------------+
| Name | -|---<- | PupilID | -|---<- | IncidentReportID |
| ... | | ... | | ... |
+---------+ +------------------+ +------------------+
Although I may not quite understand the question.
精彩评论