# reset.sql

use u64;
CREATE TABLE my_Product
(
    product_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(60) NOT NULL,
    cat_code VARCHAR(3) NOT NULL,
    price DECIMAL(6,2) NOT NULL,
    quantity INT NOT NULL,
    image_file VARCHAR(55) NOT NULL
);

DELETE FROM my_Product;

LOAD DATA LOCAL INFILE 'Products.csv'
INTO TABLE my_Product
FIELDS TERMINATED BY ',';

CREATE TABLE my_Order
(
    order_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    customer_id INT NOT NULL,
    order_status VARCHAR(2) NOT NULL,
    date_time DATETIME NOT NULL
);


CREATE TABLE my_OrderItem
(
    order_item_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    order_item_name VARCHAR(70) NOT NULL,
    order_item_status VARCHAR(2) NOT NULL,
    order_id INT NOT NULL,
    product_id INT NOT NULL,
    quantity INT NOT NULL,
    price DECIMAL(6,2) NOT NULL
);