26
loading...
This website collects cookies to deliver better user experience
customers
(customer_id
int PRIMARY KEY AUTO_INCREMENT,first_name
VARCHAR,last_name
VARCHAR,city
VARCHAR,mobile_no
VARCHAR,pancard_no
VARCHAR,dob
VARCHAR,created_at
timestampz DEFAULT "now()",deleted_at
timestampzbranchs
(branch_id
int PRIMARY KEY AUTO_INCREMENT,branch_name
VARCHAR,branch_location
VARCHAR,created_at
timestampz DEFAULT "now()",deleted_at
timestampzaccounts
(account_id
bigserial PRIMARY KEY,customer_id
int,balance
bigint,account_status
VARCHAR,account_type
VARCHAR,currency
VARCHAR,created_at
timestampz DEFAULT "now()",deleted_at
timestampztransactions
(transaction_id
bigserial PRIMARY KEY,transaction_type
VARCHAR,from_account_id
bigint,to_account_id
bigint,date_issued
date,amount
bigint,transaction_medium
VARCHAR,created_at
timestampz DEFAULT "now()",deleted_at
timestampzloans
(loan_id
bigserial PRIMARY KEY,customer_id
int,branch_id
int,loan_amount
bigint,date_issued
date,created_at
timestampz DEFAULT "now()",deleted_at
timestampzaccounts
ADD FOREIGN KEY (customer_id
) REFERENCES customers
(customer_id
);transactions
ADD FOREIGN KEY (from_account_id
) REFERENCES accounts
(account_id
);transactions
ADD FOREIGN KEY (to_account_id
) REFERENCES accounts
(account_id
);loans
ADD FOREIGN KEY (customer_id
) REFERENCES customers
(customer_id
);loans
ADD FOREIGN KEY (branch_id
) REFERENCES branchs
(branch_id
);"customers"
("customer_id"
SERIAL PRIMARY KEY,"first_name"
VARCHAR,"last_name"
VARCHAR,"city"
VARCHAR,"mobile_no"
VARCHAR,"pancard_no"
VARCHAR,"dob"
VARCHAR,"created_at"
timestampz DEFAULT 'now()',"deleted_at"
timestampz"branchs"
("branch_id"
SERIAL PRIMARY KEY,"branch_name"
VARCHAR,"branch_location"
VARCHAR,"created_at"
timestampz DEFAULT 'now()',"deleted_at"
timestampz"accounts"
("account_id"
bigserial PRIMARY KEY,"customer_id"
int,"balance"
bigint,"account_status"
VARCHAR,"account_type"
VARCHAR,"currency"
VARCHAR,"created_at"
timestampz DEFAULT 'now()',"deleted_at"
timestampz"transactions"
("transaction_id"
bigserial PRIMARY KEY,"transaction_type"
VARCHAR,"from_account_id"
bigint,"to_account_id"
bigint,"date_issued"
date,"amount"
bigint,"transaction_medium"
VARCHAR,"created_at"
timestampz DEFAULT 'now()',"deleted_at"
timestampz"loans"
("loan_id"
bigserial PRIMARY KEY,"customer_id"
int,"branch_id"
int,"loan_amount"
bigint,"date_issued"
date,"created_at"
timestampz DEFAULT 'now()',"deleted_at"
timestampz"accounts"
ADD FOREIGN KEY ("customer_id"
) REFERENCES "customers"
("customer_id"
);"transactions"
ADD FOREIGN KEY ("from_account_id"
) REFERENCES "accounts"
("account_id"
);"transactions"
ADD FOREIGN KEY ("to_account_id"
) REFERENCES "accounts"
("account_id"
);"loans"
ADD FOREIGN KEY ("customer_id"
) REFERENCES "customers"
("customer_id"
);"loans"
ADD FOREIGN KEY ("branch_id"
) REFERENCES "branchs"
("branch_id"
);