Table schema+
CREATE TABLE branches (
id integer PRIMARY KEY,
name text NOT NULL,
city text NOT NULL
);
CREATE TABLE accounts (
id integer PRIMARY KEY,
account_no text NOT NULL,
customer_name text NOT NULL,
branch_id integer NOT NULL REFERENCES branches(id),
opened_on date NOT NULL,
balance numeric(14, 2) NOT NULL
);
CREATE TABLE transactions (
id integer PRIMARY KEY,
account_id integer NOT NULL REFERENCES accounts(id),
txn_date date NOT NULL,
type text NOT NULL,
amount numeric(14, 2) NOT NULL
);