{"Ref_Document_Types": {"columns": [[0, "Document_Type_Code", "CHAR(15)", 1, null, 1], [1, "Document_Type_Name", "VARCHAR(255)", 1, null, 0], [2, "Document_Type_Description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["Document_Type_Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Document_Type_Code"]]], "check_constraints": []}, "Ref_Budget_Codes": {"columns": [[0, "Budget_Type_Code", "CHAR(15)", 1, null, 1], [1, "Budget_Type_Description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["Budget_Type_Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Budget_Type_Code"]]], "check_constraints": []}, "Projects": {"columns": [[0, "Project_ID", "INTEGER", 1, null, 1], [1, "Project_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Project_ID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Documents": {"columns": [[0, "Document_ID", "INTEGER", 1, null, 1], [1, "Document_Type_Code", "CHAR(15)", 1, null, 0], [2, "Project_ID", "INTEGER", 1, null, 0], [3, "Document_Date", "DATETIME", 0, null, 0], [4, "Document_Name", "VARCHAR(255)", 0, null, 0], [5, "Document_Description", "VARCHAR(255)", 0, null, 0], [6, "Other_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Document_ID"], "foreign_keys": [[0, 0, "Projects", "Project_ID", "Project_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Ref_Document_Types", "Document_Type_Code", "Document_Type_Code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Statements": {"columns": [[0, "Statement_ID", "INTEGER", 1, null, 1], [1, "Statement_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Statement_ID"], "foreign_keys": [[0, 0, "Documents", "Statement_ID", "Document_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Documents_with_Expenses": {"columns": [[0, "Document_ID", "INTEGER", 1, null, 1], [1, "Budget_Type_Code", "CHAR(15)", 1, null, 0], [2, "Document_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Document_ID"], "foreign_keys": [[0, 0, "Documents", "Document_ID", "Document_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Ref_Budget_Codes", "Budget_Type_Code", "Budget_Type_Code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Accounts": {"columns": [[0, "Account_ID", "INTEGER", 1, null, 1], [1, "Statement_ID", "INTEGER", 1, null, 0], [2, "Account_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Account_ID"], "foreign_keys": [[0, 0, "Statements", "Statement_ID", "Statement_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Ref_Document_Types (
    Document_Type_Code CHAR(15) NOT NULL  PRIMARY KEY,
    Document_Type_Name VARCHAR(255) NOT NULL,
    Document_Type_Description VARCHAR(255) NOT NULL,
    UNIQUE (Document_Type_Code)
);

CREATE TABLE Ref_Budget_Codes (
    Budget_Type_Code CHAR(15) NOT NULL  PRIMARY KEY,
    Budget_Type_Description VARCHAR(255) NOT NULL,
    UNIQUE (Budget_Type_Code)
);

CREATE TABLE Projects (
    Project_ID INTEGER NOT NULL  PRIMARY KEY,
    Project_Details VARCHAR(255)
);

CREATE TABLE Documents (
    Document_ID INTEGER NOT NULL  PRIMARY KEY,
    Document_Type_Code CHAR(15) NOT NULL,
    Project_ID INTEGER NOT NULL,
    Document_Date DATETIME,
    Document_Name VARCHAR(255),
    Document_Description VARCHAR(255),
    Other_Details VARCHAR(255),
    FOREIGN KEY (Project_ID) REFERENCES Projects(Project_ID),
    FOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types(Document_Type_Code)
);

CREATE TABLE Statements (
    Statement_ID INTEGER NOT NULL  PRIMARY KEY,
    Statement_Details VARCHAR(255),
    FOREIGN KEY (Statement_ID) REFERENCES Documents(Document_ID)
);

CREATE TABLE Documents_with_Expenses (
    Document_ID INTEGER NOT NULL  PRIMARY KEY,
    Budget_Type_Code CHAR(15) NOT NULL,
    Document_Details VARCHAR(255),
    FOREIGN KEY (Document_ID) REFERENCES Documents(Document_ID),
    FOREIGN KEY (Budget_Type_Code) REFERENCES Ref_Budget_Codes(Budget_Type_Code)
);

CREATE TABLE Accounts (
    Account_ID INTEGER NOT NULL  PRIMARY KEY,
    Statement_ID INTEGER NOT NULL,
    Account_Details VARCHAR(255),
    FOREIGN KEY (Statement_ID) REFERENCES Statements(Statement_ID)
);