Generate Random Data Function with Mysql
Function Helper DROP FUNCTION IF EXISTS generate_fname; DELIMITER $$ CREATE FUNCTION generate_fname () RETURNS VARCHAR(255) BEGIN RETURN ELT(FLOOR(1 + (RAND() * (50-1))), "Deni","Desi","Dito","Femi","Hafid","Rizki","Utami","Aulia","Tika","Hadi","Bayu","Annisa","Retno","Fajar","Wulandari","Nurul","Rini","Ilham","Kusuma","Rizki","Dinda","Andre","Ari","Maria","Wahyu","Mila","Lia","Kartika","Indra","Eko","Kurniawan","Sari","Ajie","Sri","Tyas","Dian","Lestari","Maya","Ika","Arya","Yudi","Andy","Anthony","Siti","Rio","Sarah","Reza","Andi","Fitri","Nur","Ade","Agus","Tri","Indah","Dian","Putra","Muhammad","Dwi","Jeffrey","Melissa","Eric","Anna","Stephen","Andrew"); END$$ DELIMITER ; DROP FUNCTION IF EXISTS generate_lname; DELIMITER $$ CREATE FUNCTION generate_lname () RETURNS VARCHAR(255) BEGIN RETURN ELT(FLOOR(1 + (RAND() * (58-1))), "Bagaskoro","Bakti","Dewangga","Dharma","Danastri","Danurdara","Diajeng","Endaru","Endang","Elok","Erina","Estiana","Gadhing","Ganendra","Gardara","Martin","Gentala","Galih","Ganesh","Gibran","Guinandra","Gumelar","Gunawan","Guntur","Guritno","Gusti","Gahyaka","Gantari","Ihsan","Ismoyono","Indira","Intan","Isthika","Jamal","Janu","Jatmika","Jaya","Jenaka","Jenggala","Jumanta","Jumantara","Kamajaya","Karunia","Kawindra","Kresna","Garini","Gayatri","Gemani","Gemintang","Gempita","Ginanita","Hakim","Halim","Hamdan","Hanafi","Handaru","Hapsari","Hardana","Haribawa"); END$$ DELIMITER ; Example query SELECT generate_fname() AS […]