{"Customers": {"columns": [[0, "Customer_ID", "INTEGER", 1, null, 1], [1, "Customer_Details", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["Customer_ID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Staff": {"columns": [[0, "Staff_ID", "INTEGER", 1, null, 1], [1, "Staff_Details", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["Staff_ID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Policies": {"columns": [[0, "Policy_ID", "INTEGER", 1, null, 1], [1, "Customer_ID", "INTEGER", 1, null, 0], [2, "Policy_Type_Code", "CHAR(15)", 1, null, 0], [3, "Start_Date", "DATETIME", 0, null, 0], [4, "End_Date", "DATETIME", 0, null, 0]], "primary_keys": ["Policy_ID"], "foreign_keys": [[0, 0, "Customers", "Customer_ID", "Customer_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Claim_Headers": {"columns": [[0, "Claim_Header_ID", "INTEGER", 1, null, 1], [1, "Claim_Status_Code", "CHAR(15)", 1, null, 0], [2, "Claim_Type_Code", "CHAR(15)", 1, null, 0], [3, "Policy_ID", "INTEGER", 1, null, 0], [4, "Date_of_Claim", "DATETIME", 0, null, 0], [5, "Date_of_Settlement", "DATETIME", 0, null, 0], [6, "Amount_Claimed", "DECIMAL(20,4)", 0, null, 0], [7, "Amount_Piad", "DECIMAL(20,4)", 0, null, 0]], "primary_keys": ["Claim_Header_ID"], "foreign_keys": [[0, 0, "Policies", "Policy_ID", "Policy_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Claims_Documents": {"columns": [[0, "Claim_ID", "INTEGER", 1, null, 1], [1, "Document_Type_Code", "CHAR(15)", 1, null, 2], [2, "Created_by_Staff_ID", "INTEGER", 0, null, 0], [3, "Created_Date", "INTEGER", 0, null, 0]], "primary_keys": ["Claim_ID", "Document_Type_Code"], "foreign_keys": [[0, 0, "Staff", "Created_by_Staff_ID", "Staff_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Claim_Headers", "Claim_ID", "Claim_Header_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Claim_ID"], [1, 1, "Document_Type_Code"]]], "check_constraints": []}, "Claims_Processing_Stages": {"columns": [[0, "Claim_Stage_ID", "INTEGER", 1, null, 1], [1, "Next_Claim_Stage_ID", "INTEGER", 0, null, 0], [2, "Claim_Status_Name", "VARCHAR(255)", 1, null, 0], [3, "Claim_Status_Description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["Claim_Stage_ID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Claims_Processing": {"columns": [[0, "Claim_Processing_ID", "INTEGER", 1, null, 1], [1, "Claim_ID", "INTEGER", 1, null, 0], [2, "Claim_Outcome_Code", "CHAR(15)", 1, null, 0], [3, "Claim_Stage_ID", "INTEGER", 1, null, 0], [4, "Staff_ID", "INTEGER", 0, null, 0]], "primary_keys": ["Claim_Processing_ID"], "foreign_keys": [[0, 0, "Staff", "Staff_ID", "Staff_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Claim_Headers", "Claim_ID", "Claim_Header_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Customers (
    Customer_ID INTEGER NOT NULL  PRIMARY KEY,
    Customer_Details VARCHAR(255) NOT NULL
);

CREATE TABLE Staff (
    Staff_ID INTEGER NOT NULL  PRIMARY KEY,
    Staff_Details VARCHAR(255) NOT NULL
);

CREATE TABLE Policies (
    Policy_ID INTEGER NOT NULL  PRIMARY KEY,
    Customer_ID INTEGER NOT NULL,
    Policy_Type_Code CHAR(15) NOT NULL,
    Start_Date DATETIME,
    End_Date DATETIME,
    FOREIGN KEY (Customer_ID) REFERENCES Customers(Customer_ID)
);

CREATE TABLE Claim_Headers (
    Claim_Header_ID INTEGER NOT NULL  PRIMARY KEY,
    Claim_Status_Code CHAR(15) NOT NULL,
    Claim_Type_Code CHAR(15) NOT NULL,
    Policy_ID INTEGER NOT NULL,
    Date_of_Claim DATETIME,
    Date_of_Settlement DATETIME,
    Amount_Claimed DECIMAL(20,4),
    Amount_Piad DECIMAL(20,4),
    FOREIGN KEY (Policy_ID) REFERENCES Policies(Policy_ID)
);

CREATE TABLE Claims_Documents (
    Claim_ID INTEGER NOT NULL  PRIMARY KEY,
    Document_Type_Code CHAR(15) NOT NULL  PRIMARY KEY,
    Created_by_Staff_ID INTEGER,
    Created_Date INTEGER,
    PRIMARY KEY (Claim_ID, Document_Type_Code),
    UNIQUE (Claim_ID, Document_Type_Code),
    FOREIGN KEY (Created_by_Staff_ID) REFERENCES Staff(Staff_ID),
    FOREIGN KEY (Claim_ID) REFERENCES Claim_Headers(Claim_Header_ID)
);

CREATE TABLE Claims_Processing_Stages (
    Claim_Stage_ID INTEGER NOT NULL  PRIMARY KEY,
    Next_Claim_Stage_ID INTEGER,
    Claim_Status_Name VARCHAR(255) NOT NULL,
    Claim_Status_Description VARCHAR(255) NOT NULL
);

CREATE TABLE Claims_Processing (
    Claim_Processing_ID INTEGER NOT NULL  PRIMARY KEY,
    Claim_ID INTEGER NOT NULL,
    Claim_Outcome_Code CHAR(15) NOT NULL,
    Claim_Stage_ID INTEGER NOT NULL,
    Staff_ID INTEGER,
    FOREIGN KEY (Staff_ID) REFERENCES Staff(Staff_ID),
    FOREIGN KEY (Claim_ID) REFERENCES Claim_Headers(Claim_Header_ID)
);