Created
September 3, 2020 09:32
-
-
Save Nothing-Works/2bc3b5fd6f694e8f42b00e5230bb99dd to your computer and use it in GitHub Desktop.
SP for inserting data
This file contains hidden or 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
| DROP PROCEDURE IF EXISTS test; | |
| DELIMITER # | |
| CREATE PROCEDURE test() | |
| BEGIN | |
| DECLARE i INT UNSIGNED DEFAULT 1; | |
| WHILE i < 100000 DO | |
| insert into video_downloads (user_id, video_id, download_at) values ((rand() * 10000),(rand() * 1000),FROM_UNIXTIME( | |
| UNIX_TIMESTAMP('2015-04-30 14:53:27') + FLOOR(0 + (RAND() * 315360000)) | |
| )); | |
| SET i = i + 1; | |
| END WHILE; | |
| COMMIT; | |
| END # | |
| DELIMITER ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment