DELIMITER $$ DROP PROCEDURE IF EXISTS student_insert_while; $$ create procedure student_insert_while(in username varchar(45), in birthday date, in age int) begin declare i int default 0; while i < 10 do insert into student (username, birthday, age) values(concat("abc", i), sysdate(), i); set i = i + 1; end while; end; $$ DELIMITER ; DELIMITER $$ DROP PROCEDURE IF EXISTS student_insert_repeat; $$ create procedure student_insert_repeat(in username varchar(45), in birthday date, in age int) begin declare i int default 0; repeat insert into student (username, birthday, age) values(concat("abc", i), sysdate(), i); set i = i + 1; until i >= 5 end repeat; end; $$ DROP PROCEDURE IF EXISTS student_insert_loop; $$ create procedure student_insert_loop(in username varchar(45), in birthday date, in age int) begin declare i int default 0; loop_label:loop insert into student (username, birthday, age) values(concat("abc", i), sysdate(), i); set i = i + 1; if i >= 5 then leave loop_label; end if; end loop; end; $$