What is the best approach for entities with similar and different information?

Asked

Viewed 14 times

0

I’m doing a project that consists of two entities: student and psychologist. Both have information in common, such as: login, first name, last name, age, contact, address. Both entities also have different information, such as: student: enrollment, course, semester of admission; psychologist: registration, crp, etc.

At first I didn’t want to create two different tables with the same things for both, so I abstracted to the maximum and created something similar to the diagram below:

inserir a descrição da imagem aqui

However, my question is whether this step can be improved. As I ended up creating two tables to put the specific information of each entity the table of positions seems useless.

1 answer

0

It’s about that, the term for the technician for the modeling you’re doing is 'specialization or generalization'.

https://sites.google.com/site/uniplibancodedados1/aulas/aula-9---generalizacao-e-especializacao

The detail is that you can make the student, or psychologist id a foreign key to the entity user, this will make your life easier when you want to search for all users, or users with one another feature.

p.s.: I was going to post this reply as a comment but I’m still a new user around here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.