-- MySQL LOAD DATA scripts for the ToyBank database -- by Dr. Alvaro Monge -- The customersTabbed.txt file has tab-delimited attribute values -- with one row per line... so the defaults of the -- LOAD DATA statement are sufficient LOAD DATA LOCAL INFILE 'D:\\customersTabbed.txt' REPLACE INTO TABLE customers; -- The remaining data files have comma-delimited attribute values -- The branches table was created with an AUTO_INCREMENT -- attribute for the id of a branch, so MySQL will generate -- the values for that attribute. That's why the data file -- does not have a value for the ID's of a branch. We do need -- to specify in this statement that the data from the file is -- to be loaded into the named columns in the order provided. LOAD DATA LOCAL INFILE 'D:\\branches.txt' REPLACE INTO TABLE branches FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' (street,city,state,zipcode,assets); LOAD DATA LOCAL INFILE 'D:\\accounts.txt' REPLACE INTO TABLE accounts FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'; LOAD DATA LOCAL INFILE 'D:\\loans.txt' REPLACE INTO TABLE loans FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'; LOAD DATA LOCAL INFILE 'D:\\depositors.txt' REPLACE INTO TABLE depositors FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n';