1

Let's say I want to store information about several persons in an database. Every person can have no, one or more roles. Each role has some attributes like a name, number and so on (the roles have different attributes).

In my opinion this relationship between a Person and a Role can be described as "IS A". Am I right?

0

1 Answer 1

3

I can see how colloquial English (or ESL) might indicate that a person indeed "is" a job role. However, you're dealing with a system of possibilities and ownership rather than the fact that, at least Americans, like to reduce a person's existence to their career role.

"She is a police officer" - works during standard conversation.

"He has a role of police officer" - reflects the possibility of no, one, or more roles that a person may own. You're dealing with composition not subtyping.

CREATE TABLE is one of the most basic aspects of SQL... you're only hurting yourself if you don't take the time to actually learn the language. Here's one good starting resource. Your next step will likely be to add a Foreign Key constraint.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.