Created
April 13, 2022 05:05
-
-
Save idandagan1/e156a265e14e9cc5de6c2aa490782069 to your computer and use it in GitHub Desktop.
Populate MySQL table with random data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
CREATE PROCEDURE insert_data() | |
BEGIN | |
DECLARE i INT DEFAULT 0; | |
WHILE i < 13000000 DO | |
INSERT INTO customer (session, customer_id, product_id) VALUES | |
(CONCAT(i+1, '-', '4949-a976-3b125797f641'), i, i), | |
(CONCAT(i+2, '-', '4949-a976-3b125797f641'), i, i), | |
(CONCAT(i+3, '-', '4949-a976-3b125797f641'), i, i), | |
(CONCAT(i+4, '-', '4949-a976-3b125797f641'), i, i), | |
(CONCAT(i+5, '-', '4949-a976-3b125797f641'), i, i), | |
(CONCAT(i+6, '-', '4949-a976-3b125797f641'), i, i), | |
(CONCAT(i+7, '-', '4949-a976-3b125797f641'), i, i), | |
(CONCAT(i+8, '-', '4949-a976-3b125797f641'), i, i), | |
(CONCAT(i+9, '-', '4949-a976-3b125797f641'), i, i), | |
(CONCAT(i+10, '-', '4949-a976-3b125797f641'), i, i); | |
SET i = i + 11; | |
END WHILE; | |
END$$ | |
DELIMITER ; | |
CALL insert_data(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment