-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdito.sql
35 lines (29 loc) · 1.11 KB
/
dito.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
USE dito;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
DROP TABLE IF EXISTS `events`;
CREATE TABLE IF NOT EXISTS `events` (
`EVENT` varchar(15) NOT NULL DEFAULT '',
`TIMESTAMP` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP PROCEDURE IF EXISTS `insertFake`;
DELIMITER //
CREATE PROCEDURE `insertFake`()
BEGIN
DECLARE i int DEFAULT 1;
WHILE i <= 10000 DO
INSERT INTO `events` (`EVENT`, `TIMESTAMP`) VALUES
('comprou-produto', '2019-09-07 00:05:56'),
('comprou', '2019-09-07 00:06:09'),
('buy', '2019-09-07 11:38:27');
SET i = i + 1;
END WHILE;
END//
DELIMITER ;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
CALL insertFake();