1
I have a question in jobs with databases.
Exemplifying, as the image below:
Well, I know I should include in the table agendar_consulta
the user who needs a consultation and the doctor who will consult him, and this is done through foreign keys
referring to unique records of tables users
and médicos
.
Now the question:
What’s the use of me referencing Foreign Keys
(foreign keys) of the table agendar_consulta
the records of the tables users
and médicos
?
Wouldn’t have the same effect I leave the table agendar_consulta
with the fields id_medico
and id_user
as simple fields (not Foreign Key) of Integer variable and only repeat id’s independently of other tables?