One way I found and not at all elegant was this:.
Use the function substring() together with the Rand() to select a letter randomly from all of the alphabet I passed as argument.
After that use the function Concat() to concatenate all letters into one.
delimiter $$
drop procedure if exists projBD.populaAluno $$
create procedure populaAluno()
begin
declare nome varchar(100);
declare idade int ;
declare cr float;
declare counter int default 0;
while counter <= 10000 do
set nome = concat(substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1),
substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ ', rand()*28, 1)
) ;
set idade = floor(1 + (rand() * 99));
set cr = rand()*10 ;
insert into ALUNO (nome,idade,cr)
values (nome,idade,cr);
set counter = counter + 1;
end while;
End $$
delimiter ;
Take a look at this one:http://thecodecave.com/downloads/NameGeneration.sql
– StillBuggin