{"Customers": {"columns": [[0, "customer_id", "INTEGER", 0, null, 1], [1, "customer_name", "VARCHAR(80)", 0, null, 0], [2, "customer_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["customer_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Invoices": {"columns": [[0, "invoice_number", "INTEGER", 0, null, 1], [1, "invoice_date", "DATETIME", 0, null, 0], [2, "invoice_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["invoice_number"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Orders": {"columns": [[0, "order_id", "INTEGER", 0, null, 1], [1, "customer_id", "INTEGER", 1, null, 0], [2, "order_status", "VARCHAR(10)", 1, null, 0], [3, "date_order_placed", "DATETIME", 1, null, 0], [4, "order_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["order_id"], "foreign_keys": [[0, 0, "Customers", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Products": {"columns": [[0, "product_id", "INTEGER", 0, null, 1], [1, "product_name", "VARCHAR(80)", 0, null, 0], [2, "product_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["product_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Order_Items": {"columns": [[0, "order_item_id", "INTEGER", 0, null, 1], [1, "product_id", "INTEGER", 1, null, 0], [2, "order_id", "INTEGER", 1, null, 0], [3, "order_item_status", "VARCHAR(10)", 1, null, 0], [4, "order_item_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["order_item_id"], "foreign_keys": [[0, 0, "Products", "product_id", "product_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Orders", "order_id", "order_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Shipments": {"columns": [[0, "shipment_id", "INTEGER", 0, null, 1], [1, "order_id", "INTEGER", 1, null, 0], [2, "invoice_number", "INTEGER", 1, null, 0], [3, "shipment_tracking_number", "VARCHAR(80)", 0, null, 0], [4, "shipment_date", "DATETIME", 0, null, 0], [5, "other_shipment_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["shipment_id"], "foreign_keys": [[0, 0, "Invoices", "invoice_number", "invoice_number", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Orders", "order_id", "order_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Shipment_Items": {"columns": [[0, "shipment_id", "INTEGER", 1, null, 0], [1, "order_item_id", "INTEGER", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Shipments", "shipment_id", "shipment_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Order_Items", "order_item_id", "order_item_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Customers (
    customer_id INTEGER   PRIMARY KEY,
    customer_name VARCHAR(80),
    customer_details VARCHAR(255)
);

CREATE TABLE Invoices (
    invoice_number INTEGER   PRIMARY KEY,
    invoice_date DATETIME,
    invoice_details VARCHAR(255)
);

CREATE TABLE Orders (
    order_id INTEGER   PRIMARY KEY,
    customer_id INTEGER NOT NULL,
    order_status VARCHAR(10) NOT NULL,
    date_order_placed DATETIME NOT NULL,
    order_details VARCHAR(255),
    FOREIGN KEY (customer_id) REFERENCES Customers(customer_id)
);

CREATE TABLE Products (
    product_id INTEGER   PRIMARY KEY,
    product_name VARCHAR(80),
    product_details VARCHAR(255)
);

CREATE TABLE Order_Items (
    order_item_id INTEGER   PRIMARY KEY,
    product_id INTEGER NOT NULL,
    order_id INTEGER NOT NULL,
    order_item_status VARCHAR(10) NOT NULL,
    order_item_details VARCHAR(255),
    FOREIGN KEY (product_id) REFERENCES Products(product_id),
    FOREIGN KEY (order_id) REFERENCES Orders(order_id)
);

CREATE TABLE Shipments (
    shipment_id INTEGER   PRIMARY KEY,
    order_id INTEGER NOT NULL,
    invoice_number INTEGER NOT NULL,
    shipment_tracking_number VARCHAR(80),
    shipment_date DATETIME,
    other_shipment_details VARCHAR(255),
    FOREIGN KEY (invoice_number) REFERENCES Invoices(invoice_number),
    FOREIGN KEY (order_id) REFERENCES Orders(order_id)
);

CREATE TABLE Shipment_Items (
    shipment_id INTEGER NOT NULL,
    order_item_id INTEGER NOT NULL,
    FOREIGN KEY (shipment_id) REFERENCES Shipments(shipment_id),
    FOREIGN KEY (order_item_id) REFERENCES Order_Items(order_item_id)
);