Hello. I ran into the problem of deleting rows by an attached request, or to be more precise, two deletions are performed in one store, and most of all, I think that the first is performed without the subquery, and the second one does not have the necessary value.
CREATE DEFINER=`root`@`localhost` PROCEDURE `RemoveStudent`( -- Add the parameters for the stored procedure here id CHAR(36) ) BEGIN IF (SELECT Count(IdStudent) FROM GroupeStudent WHERE GroupeStudent.IdStudent = id) = 0 THEN call RemoveCourseGroupe((SELECT GroupeStudent.IdGroupe FROM GroupeStudent WHERE GroupeStudent.IdStudent = id)); END IF; DELETE FROM Student WHERE Student.Id = id; END