2
My question is about the list of tables in sql. In an academy system I want to make a relationship between the student and his training record. I made a relationship from one to one, because each student can only have one record.
Also, I put the foreign key on the chart. My goal is that when I delete a student from the system his record will be deleted as well. However, when I try to delete a student this message appears:
{com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row:}
What is my mistake? the foreign key should be on the student table?
To delete a data from a table and automatically delete the data from another vc you can use Cascade
– Rafael
That was the problem, Big Brother!
– Rafael Motta
I’m happy to help, if you can accept my answer, I thank you
– Rafael