@echo off
rem create test table
echo DROP TABLE IF EXISTS test;
echo CREATE TABLE test (id INT PRIMARY KEY, parent int, INDEX pIdx (parent)) TYPE myisam;

rem insert 3 root entries
echo INSERT INTO test VALUES (1, null);
echo INSERT INTO test VALUES (2, null);
echo INSERT INTO test VALUES (3, null);

rem insert 10000 (9997) rows which are children of row with id 1
set from1=4
set to1=10000

for /L %%i in (%from1%,1,%to1%) do echo INSERT INTO test VALUES(%%i, 1);

rem insert 20000 rows which are children of row with id 2
set from2=10001
set to2=30000

for /L %%j in (%from2%,1,%to2%) do echo INSERT INTO test VALUES(%%j, 2);

rem insert 50000 rows which are children of row with id 3
set from3=30001
set to3=80000

for /L %%k in (%from3%,1,%to3%) do echo INSERT INTO test VALUES(%%k, 3);


@echo on
