/* sql script to load csv files into db table
   - replace the <path_to_files> with correct path string before running
*/

CREATE DATABASE `atc_dataset`;

CREATE TABLE `atc_dataset`.`data` (
	`time` DOUBLE(20,3) NOT NULL,
	`id` INT(6) NOT NULL DEFAULT '-1',
	`x` INT(6) NOT NULL DEFAULT '0',
	`y` INT(6) NOT NULL DEFAULT '0',
	`z` DOUBLE(20,3) NOT NULL DEFAULT '0.000',
	`vel` DOUBLE(20,3) NOT NULL DEFAULT '0.000',
	`mTheta` DOUBLE(20,3) NOT NULL DEFAULT '0.000',
	`oTheta` DOUBLE(20,3) NOT NULL DEFAULT '0.000',
	UNIQUE INDEX `time` (`time`, `id`),
	INDEX `TimeKey` (`time`)
)
COLLATE 'utf8_general_ci' ENGINE=MyISAM ROW_FORMAT=Dynamic COMMENT='';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121024.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121028.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121031.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121104.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121107.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121111.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121114.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121118.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121121.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121125.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121128.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121202.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121205.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121209.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121212.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121216.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121219.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121223.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20121226.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130106.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130109.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130113.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130116.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130120.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130123.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130127.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130130.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130203.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130206.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130210.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130213.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130217.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130220.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130224.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130227.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130303.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130306.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130310.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130317.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130320.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130324.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130327.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130331.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130403.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130407.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130410.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130414.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130417.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130421.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130424.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130428.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130501.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130505.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130508.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130512.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130515.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130519.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130522.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130526.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130529.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130602.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130605.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130609.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130612.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130616.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130619.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130623.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130626.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130630.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130703.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130707.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130710.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130714.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130717.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130721.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130724.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130728.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130807.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130811.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130814.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130818.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130821.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130825.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130828.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130901.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130904.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130911.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130915.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130918.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130922.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';

LOAD DATA LOCAL INFILE "<path_to_files>/atc-20130925.csv" 
INTO TABLE `atc_dataset`.`data`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"';
