mysql function for Luhn algorithm to create the check digit NOT verify
This MySQL function should generate a check digit using Luhn algorithm. Given the number 345722 the function should return 3. It returns 6 which is wrong. drop function if exists luhn; delimiter // create function luhn(myNum varchar(20)) returns varchar(1) sql…