How do I apply subtypes into an SQL Server database?

前端 未结 5 935
孤独总比滥情好
孤独总比滥情好 2020-12-28 20:05

I am working on a program in which you can register complaints. There are three types of complaints: internal (errors from employees), external (er

5条回答
  •  生来不讨喜
    2020-12-28 20:37

    Is the main issue that you need some sort of "serial number" to uniquely identify a complaint regardless of which type? Basically, then, you need a table for each type of complaint (as you will have, I think), plus the master "Complaint" table with the ComplaintId. Each of the type-specific tables will have a foreign key to Complaint.ComplaintId. You may find it useful to have a "type" field in Complaint, but that isn't really required for the model.

提交回复
热议问题