You are here

Preparation for Exercises

To do the exercises you need the following:

sql> CREATE SCHEMA test;
sql> use test;
sql> CREATE TABLE `test` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT
, `data` VARxCHAR(128) DEFAULT NULL
, `ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP()
, PRIMARY KEY (`id`)
) ENGINE=InnoDB
;
sql> INSERT INTO test VALUES (NULL, 'Some data to fill the table', CURRENT_TIMESTAMP());
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;
sql> INSERT INTO test SELECT NULL, 'Some data to fill the table', CURRENT_TIMESTAMP() FROM test;