To describe my dilemma, let me first start with an example problem (stolen from here). Let's say you have a GradStudent table in your database that looks like this:
GradStudent:
firstName
lastName
birthDate
courseAssignment
researchGrant
But only teaching assistants will have a course assignment and only research assistants will have a researchGrant, so one of those two will always be null. Obviously this is not optimal and it would be better to do this:
GradStudent:
firstName
lastName
birthDate
TeachAsst:
courseAssignment
ResearchAsst:
researchGrant
Where TeachAsst and ResearchAsst have a foreign key (probably a "studentID" surrogate) from the GradStudent table.
I also understand why it wouldn't be best to make two completely separate tables like:
TeachAsst:
firstName
lastName
birthDate
courseAssignment
ResearchAsst:
firstName
lastName
birthDate
researchGrant
Because you're repeating a lot of attributes that have the same meaning.
However, two distinct classes would make sense (I think) if they had hardly any fields in common, like:
TeachAsst:
name
courseAssignment
payRate
numStudents
ResearchAsst:
name
researchGrant
facultyAdvisor
researchTopic
Here, they only have "name" in common, so would it be silly to have a GradStudent superclass with only a single attribute of "name?" Where is the tipping point? How do you decide when to have a superclass of common information, or when to leave two classes completely separate? Having a superclass makes most of CRUD a bit harder because to create or update a TeachAsst you need to change two tables instead of just one.
As another example, let's say the DB you're working on involves measuring information on different electronic devices. And while a camera and a mobile phone have length/width/height in common, most of the other measurements will not coincide (e.g. the camera won't have any audio information, and the mobile phone won't have any lens or viewport measurements). So it seems almost simpler to have a cameraData table and a mobileData that are completely separate, rather than put their little amount of common information into a superclass table. What do you think? Is there a general rule that says you should always put common data together in a superclass, even if it's a small percentage of the subclass's descriptive data?
Edit: Let's assume that in the grad student example, a grad student is either a teaching assistant or a research assistant, will never switch roles, and also is never both or neither.