{"Staff": {"columns": [[0, "staff_id", "INTEGER", 0, null, 1], [1, "gender", "VARCHAR(1)", 0, null, 0], [2, "first_name", "VARCHAR(80)", 0, null, 0], [3, "last_name", "VARCHAR(80)", 0, null, 0], [4, "email_address", "VARCHAR(255)", 0, null, 0], [5, "phone_number", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["staff_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Customers": {"columns": [[0, "customer_id", "INTEGER", 0, null, 1], [1, "customer_type_code", "VARCHAR(20)", 1, null, 0], [2, "address_line_1", "VARCHAR(80)", 0, null, 0], [3, "address_line_2", "VARCHAR(80)", 0, null, 0], [4, "town_city", "VARCHAR(80)", 0, null, 0], [5, "state", "VARCHAR(80)", 0, null, 0], [6, "email_address", "VARCHAR(255)", 0, null, 0], [7, "phone_number", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["customer_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Products": {"columns": [[0, "product_id", "INTEGER", 0, null, 1], [1, "parent_product_id", "INTEGER", 0, null, 0], [2, "product_category_code", "VARCHAR(20)", 1, null, 0], [3, "date_product_first_available", "DATETIME", 0, null, 0], [4, "date_product_discontinued", "DATETIME", 0, null, 0], [5, "product_name", "VARCHAR(80)", 0, null, 0], [6, "product_description", "VARCHAR(255)", 0, null, 0], [7, "product_price", "DECIMAL(19,4)", 0, null, 0]], "primary_keys": ["product_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Complaints": {"columns": [[0, "complaint_id", "INTEGER", 1, null, 0], [1, "product_id", "INTEGER", 1, null, 0], [2, "customer_id", "INTEGER", 1, null, 0], [3, "complaint_outcome_code", "VARCHAR(20)", 1, null, 0], [4, "complaint_status_code", "VARCHAR(20)", 1, null, 0], [5, "complaint_type_code", "VARCHAR(20)", 1, null, 0], [6, "date_complaint_raised", "DATETIME", 0, null, 0], [7, "date_complaint_closed", "DATETIME", 0, null, 0], [8, "staff_id", "INTEGER", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Customers", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Products", "product_id", "product_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Staff", "staff_id", "staff_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Staff (
    staff_id INTEGER   PRIMARY KEY,
    gender VARCHAR(1),
    first_name VARCHAR(80),
    last_name VARCHAR(80),
    email_address VARCHAR(255),
    phone_number VARCHAR(80)
);

CREATE TABLE Customers (
    customer_id INTEGER   PRIMARY KEY,
    customer_type_code VARCHAR(20) NOT NULL,
    address_line_1 VARCHAR(80),
    address_line_2 VARCHAR(80),
    town_city VARCHAR(80),
    state VARCHAR(80),
    email_address VARCHAR(255),
    phone_number VARCHAR(80)
);

CREATE TABLE Products (
    product_id INTEGER   PRIMARY KEY,
    parent_product_id INTEGER,
    product_category_code VARCHAR(20) NOT NULL,
    date_product_first_available DATETIME,
    date_product_discontinued DATETIME,
    product_name VARCHAR(80),
    product_description VARCHAR(255),
    product_price DECIMAL(19,4)
);

CREATE TABLE Complaints (
    complaint_id INTEGER NOT NULL,
    product_id INTEGER NOT NULL,
    customer_id INTEGER NOT NULL,
    complaint_outcome_code VARCHAR(20) NOT NULL,
    complaint_status_code VARCHAR(20) NOT NULL,
    complaint_type_code VARCHAR(20) NOT NULL,
    date_complaint_raised DATETIME,
    date_complaint_closed DATETIME,
    staff_id INTEGER NOT NULL,
    FOREIGN KEY (customer_id) REFERENCES Customers(customer_id),
    FOREIGN KEY (product_id) REFERENCES Products(product_id),
    FOREIGN KEY (staff_id) REFERENCES Staff(staff_id)
);