3.18作业
drop procedure if exists dcsba22;create procedure dcsba22(n int)
begin
declare i int default(select count(*) from user);
drop table if exists user ;
create table user(id int(10) primary key auto_increment,
user_name varchar(16),
user_pwd int(20)default "123456",
verify varchar(6));
if n <= i then
select * from user;
else
while n > i do
insert into user(user_name,user_pwd,verify) values(concat(substring(md5(rand()),1,8),md5(rand()),1,8),
"123456",concat(substring(md5(rand()),1,3),md5(rand()),1,3));
set i = i + 1;
end while;
end if;
end
call dcsba22(1000);
select * from user;
页:
[1]