text: DELIMITER $$
  CREATE DEFINER=`root`@`%` PROCEDURE `getPossibleFathersBasedOnAge`(IN `PersonAgeIn` DATE)
      SQL SECURITY INVOKER
      COMMENT 'To get the possible fathers of a person based on the persons bir'
  BEGIN
  
  	SELECT DISTINCT
  
      
  
      P.PersonID as PossibleFatherID, 
  
      concat(P.PersonGivvenName, ' ', P.PersonFamilyName) as PossibleFather
  
      
  
      FROM persons P 
  
  
  
      WHERE P.PersonIsMale = true
  
      AND YEAR(P.PersonDateOfBirth) < (YEAR(PersonAgeIn) - 15)
  
  		
  
  	AND YEAR(P.PersonDateOfBirth) > (YEAR(PersonAgeIn) - 50)
  
          
  
      ORDER BY P.PersonDateOfBirth;
  
   END$$
  DELIMITER ;
  