DROP DATABASE IF EXISTS politie;

CREATE DATABASE politie;

use politie;

drop table tab1;

CREATE TABLE tab1 (
  tab1 int NOT NULL,
  name varchar(50) NOT NULL,
  PRIMARY KEY (tab1)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


DROP PROCEDURE filltab1;

DELIMITER $$

CREATE PROCEDURE filltab1()
BEGIN
    DECLARE i INT DEFAULT 1;
    WHILE i <= 1000000 DO
        INSERT INTO tab1 (tab1,name) values (i, concat('name',i));   
        SET i = i + 1;    
    END WHILE;
END $$

DELIMITER ;

call filltab1();

DROP TABLE tab2;

CREATE TABLE tab2 (
  tab2 int NOT NULL,
  address varchar(50) NOT NULL,
  postalcode varchar(50) NOT NULL,
  city varchar(50) NOT NULL,
  PRIMARY KEY (tab2)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

drop procedure filltab2;

DELIMITER $$

CREATE PROCEDURE filltab2()
BEGIN
    DECLARE i INT DEFAULT 1;
    WHILE i <= 2000000 DO
        INSERT INTO tab2 (tab2, address,postalcode,city) values (i, concat('address',i),concat('postalcode',i),concat('city',i));
        SET i = i + 1;        
    END WHILE;
END $$

DELIMITER ;

call filltab2();

DROP TABLE tab3;

CREATE TABLE tab3 (
  tab3 int NOT NULL,
  person varchar(50) NOT NULL,
  PRIMARY KEY (tab3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

drop procedure filltab3;
 
DELIMITER $$

CREATE PROCEDURE filltab3()
BEGIN
    DECLARE i INT DEFAULT 1;
    WHILE i <= 1000000 DO
        INSERT INTO tab3 (tab3, person) values (i, concat('person',i));
        SET i = i + 1;        
    END WHILE;
END $$

DELIMITER ;

call filltab3();