forked from msipsb/Project_DB_Lecture
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser_table3.sql
More file actions
38 lines (32 loc) · 1.47 KB
/
Copy pathparser_table3.sql
File metadata and controls
38 lines (32 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-- Location of file -> 'D:/SIIT/Project_DB_Lecture/data_sampled/orders_sampled_filtered.csv'
-- insert orders_sampled_filtered.csv data into orders table
LOAD DATA LOCAL INFILE 'D:/SIIT/Project_DB_Lecture/data_sampled_2/orders_sampled_filtered_mapped.csv'
INTO TABLE orders
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 ROWS
(order_ID, customer_ID, eval_set, order_number, order_dow, order_hour_of_day, @days)
SET days_since_prior_order = NULLIF(TRIM(@days), '');
-- Location of file -> 'D:/SIIT/Project_DB_Lecture/data_sampled/products_with_retailer.csv'
-- insert products_with_retailer.csv data into products table
LOAD DATA LOCAL INFILE 'D:/SIIT/Project_DB_Lecture/data_sampled_2/products_filtered_plus500_mapped_with_retailer.csv'
INTO TABLE products
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;
-- Location of file -> 'D:/SIIT/Project_DB_Lecture/data_sampled/order_products_combined_filtered.csv'
-- insert order_products_combined_filtered.csv data into order_products table
LOAD DATA LOCAL INFILE 'D:/SIIT/Project_DB_Lecture/data_sampled_2/order_products_with_review_mapped_final.csv'
INTO TABLE order_products
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;
LOAD DATA LOCAL INFILE 'D:/SIIT/Project_DB_Lecture/data_random/inventory_record.csv'
INTO TABLE inventory_record
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;