CREATE TABLE IF NOT EXISTS products(
    product_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    code VARCHAR(50) NOT NULL,
    title VARCHAR(50) NOT NULL,
    UNIQUE(code, title)
);

CREATE TABLE IF NOT EXISTS stocks(
    stock_id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    date DATE NOT NULL,
    product_id INT NOT NULL,
    display_count INT NOT NULL,
    stock_count INT NOT NULL,
    sale_count INT NOT NULL,
    UNIQUE(date, product_id)
);
