{"Accounts": {"columns": [[0, "account_id", "INTEGER", 0, null, 1], [1, "customer_id", "INTEGER", 1, null, 0], [2, "account_name", "VARCHAR(50)", 0, null, 0], [3, "other_account_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["account_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Customers": {"columns": [[0, "customer_id", "INTEGER", 0, null, 1], [1, "customer_first_name", "VARCHAR(20)", 0, null, 0], [2, "customer_last_name", "VARCHAR(20)", 0, null, 0], [3, "customer_address", "VARCHAR(255)", 0, null, 0], [4, "customer_phone", "VARCHAR(255)", 0, null, 0], [5, "customer_email", "VARCHAR(255)", 0, null, 0], [6, "other_customer_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["customer_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Customers_Cards": {"columns": [[0, "card_id", "INTEGER", 0, null, 1], [1, "customer_id", "INTEGER", 1, null, 0], [2, "card_type_code", "VARCHAR(15)", 1, null, 0], [3, "card_number", "VARCHAR(80)", 0, null, 0], [4, "date_valid_from", "DATETIME", 0, null, 0], [5, "date_valid_to", "DATETIME", 0, null, 0], [6, "other_card_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["card_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Financial_Transactions": {"columns": [[0, "transaction_id", "INTEGER", 1, null, 0], [1, "previous_transaction_id", "INTEGER", 0, null, 0], [2, "account_id", "INTEGER", 1, null, 0], [3, "card_id", "INTEGER", 1, null, 0], [4, "transaction_type", "VARCHAR(15)", 1, null, 0], [5, "transaction_date", "DATETIME", 0, null, 0], [6, "transaction_amount", "DOUBLE", 0, null, 0], [7, "transaction_comment", "VARCHAR(255)", 0, null, 0], [8, "other_transaction_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Accounts", "account_id", "account_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Customers_Cards", "card_id", "card_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Accounts (
    account_id INTEGER   PRIMARY KEY,
    customer_id INTEGER NOT NULL,
    account_name VARCHAR(50),
    other_account_details VARCHAR(255)
);

CREATE TABLE Customers (
    customer_id INTEGER   PRIMARY KEY,
    customer_first_name VARCHAR(20),
    customer_last_name VARCHAR(20),
    customer_address VARCHAR(255),
    customer_phone VARCHAR(255),
    customer_email VARCHAR(255),
    other_customer_details VARCHAR(255)
);

CREATE TABLE Customers_Cards (
    card_id INTEGER   PRIMARY KEY,
    customer_id INTEGER NOT NULL,
    card_type_code VARCHAR(15) NOT NULL,
    card_number VARCHAR(80),
    date_valid_from DATETIME,
    date_valid_to DATETIME,
    other_card_details VARCHAR(255)
);

CREATE TABLE Financial_Transactions (
    transaction_id INTEGER NOT NULL,
    previous_transaction_id INTEGER,
    account_id INTEGER NOT NULL,
    card_id INTEGER NOT NULL,
    transaction_type VARCHAR(15) NOT NULL,
    transaction_date DATETIME,
    transaction_amount DOUBLE,
    transaction_comment VARCHAR(255),
    other_transaction_details VARCHAR(255),
    FOREIGN KEY (account_id) REFERENCES Accounts(account_id),
    FOREIGN KEY (card_id) REFERENCES Customers_Cards(card_id)
);