mysql循环怎么写呀!!!

学下mysql的循环,写了点代码不太理解里面的意思,执行成功了也没添加数据图片说明图片说明
在执行就报错

delimiter $$    // 定义结束符为 $$
drop procedure if exists wk; // 删除 已有的 存储过程
create procedure wk()      //  创建新的存储过程
begin
declare i int;          // 变量声明
set i = 1;     
while i < 11 do           // 循环体
insert into user_profile (uid) values (i);
set i = i +1;
end while;
end $$               // 结束定义语句

// 调用

delimiter ;          // 先把结束符 回复为;
call wk();

1、while循环、2、repeat循环、3、loop循环,本人使用while比较多
写法如下:
delimiter
drop procedure if exists test;
create procedure test()
begin
declare i int;
set i = 0;
while i < 10 do
insert into test values (i);
set i = i + 1;
end while;
select * from test;
end
call test();