Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chandra-prakash-meghwal/0732790e8b8cf48a60ec8590be6d9e79 to your computer and use it in GitHub Desktop.
Save chandra-prakash-meghwal/0732790e8b8cf48a60ec8590be6d9e79 to your computer and use it in GitHub Desktop.
Add sample customers to customers db table in mysql
drop procedure if exists populate_customers;
delimiter //
create procedure populate_customers (in num int)
begin
declare i int default 0;
while i < num do
insert into customers (customer_id, name, email) values ((num*10)+i, concat('name', i), concat('email', i));
set i = i + 1;
end while;
end //
delimiter ;
call populate_customers (500000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment