SQL Day5
SQL Day5
RETURN year(today)-year(dob);
END
use abc;
select demo123();
-----------------------------------------------------------------------------------
-----------------------------
CREATE DEFINER=`root`@`localhost` FUNCTION `parameter`(num int) RETURNS varchar(20)
CHARSET utf8mb4
READS SQL DATA
DETERMINISTIC
BEGIN
RETURN num;
END
-----------------------------------------------------------------------------------
-------------------------------
DETERMINISTIC : -
-- > when using non deterministic for determinsitic type of function will take
unwanted execution time
NONDITERMINISTIC : -
-- > when using deterministic for nondeterministic methods might return wrong
results
-----------------------------------------------------------------------------------
-------------------------------
-----------------------------------------------------------------------------------
-------------------------------
call abc.abc();