This is the bank database management system.
The aim of this project is to create a complete system that represents the banking database with the CRUD operations performed in the database with the schema design developed from scratch.
This is a learning project should be used into development/production environment at your own risk
- Define rules.
- Create rough schema banking system.
- Create ER diagram
- Create Tables and define relations
- Set up db
- Create pre defined data
- Create function
- Create Triggers
- Enter dummy data.
- Create views.
- Write queries.
- Backup database in regular intervals.
- how to deploy a psql database on server.
- Operating System: Ubuntu
- Database: postgreSql
- Tool: PgAdmin, drawsql.app
- This is the complete schema design for a single bank which includes banks in multiple areas.
- Two type of account are supported in this version
- Saving account
- Saving account has a minimum balance limit of Rs.1000, Account with balance lower than this Rs.25 will be deducted monthly.
- Interest rate of 2.5% is provided on the balance of saving account which is calculated monthly.
- Interest rate is static 2.5% currently but we can change this and make it variable based on the requirement.
- Current account
- Current account has a minimum balance limit of Rs.5000, Account with balance lower than this Rs.25 will be deducted monthly.
- Non-maintenance fee Rs.1500 will be charged quarterly for current account.
- Further restrictions will be imposed on withdrawal of money from atm etc.
- Saving account
- Loan will also be provided to a individual based on his/her monthly income. Two type of loan are supported into the application.
- Fixed rate loan
- 3% pre loan payment charges.
- 10% interest rate will be applicable on the loan.
- Floating rate loan
- No pre loan payment charges will be applied.
- Interest rate will be calculated based on the market situations.
- Fixed rate loan
- A customer can create a FD.
- 6% of interest rate will be provided on an FD.
- In case of early cancellation of FD interest of last month would be deducted.
- Every branch will have it's own account with initial balance of 1cr, This balance will be used to give loans, Also when a FD is created FD amount will be deposited to this account.
- DesignLink:- Link
- Diagram Link:- Link
-
For the simplicity purpose lets create a database bank with one user bank owner. We can also implement access control/role base access into the database.
##Create Role CREATE ROLE bankowner WITH LOGIN PASSWORD 'root'; ##Create Database CREATE DATABASE bank WITH OWNER = bankowner; ##By default anyone can connect the database bank so revoke all permissions from public. REVOKE ALL ON DATABASE bank FROM PUBLIC; ##Login on database bank with bankOwner psql -U bankowner -d bank;
- Area table should contain all list of area with the required information.
- Bank needs to be pre-defined.
- Every bank has it's own account with balance of 1cr.
- Sql file with pre-defined data. link
- Account
- Create customer
- Create account
- Create joint account
- Calculate saving account interest
- Deposit saving account interest
- Deduct current account charges
- Deduct saving charges which is under minimum limit
- Loan
- Create Loan
- Deduct EMI
- FD
- For FD triggers we can create function and triggers similar to saving_account_interest.
- COMMIT and ROLLBACK used for the transactions cannot be used inside a function in postgresql so to manage ACID properties of the transaction we will LOCK the specific rows for update and release after updating it.