You are on page 1of 2

Online Banking DB Design

1. Create table called customer with following column information

i) AccountNumber – Use Primary Key & Identity function with seed =


100000 and increment= 1
ii) CustomerName –Not Null
iii) Address –Not Null
iv) Email Id - unique –Should not allow duplicates
v) Contact No# - unique- Should not allow duplicates
vi) AccountType – Varchar – Check Constraint to allow only ‘Saving’
‘Current’, ‘Salary’ and ‘Corporate’ values.
vii) Balance - Money type Not null Check (balance>1000)

2. Create stored procedures for insert/update/delete record in the customer table


with following conditions.
i) Email ID format should have “@” and “.” Symbols
ii) Contact Number should include ISD code start with “+”
3. Create a table called PayeesList to store list of other customer details to whom
customer want to transfer funds online
Column Information:
i) PayerAccountNumber FK to Customer.AccountNumber
ii) PayeeAccountNumber FK to Customer.AccountNumber
iii) PayeeNickName Not Null
4. Create stored procedures for insert/update/delete record in the PayeesList
table with following conditions.
i) Payer can add any number of payees
ii) Combination of PayerAccountNumber and PayeeAccountNumber
should not allow duplicate- use composite primary key
5. Create a table called TransactionLog which will track transaction of all
customers on every day.

Column Information:
i) TransactionID – PK and Identity Function seed 500000 and increment =1
ii) Transaction Date-DateTime
iii) TransactionType – Check- as of now only allowed values are
‘OnlineFundTransfer’/ ’MobileFundTransfer’
iv) PayerAccountNumber - Col FK to Customer.AccountNumber
v) PayeeAccountNumber FK to Customer.AccountNumber
vi) TransferAmount – Money

6. Create stored procedures for insert a record in the TransactionLog table with
following conditions.
i) Payer can do any number of transactions on every day.
Online Banking DB Design

ii) Payer can transfer the funds to other only when he registered others in his
payee list. (should refer PayeeList table)-Create a trigger for this.
iii) Maximum limit on fund transfer should not exceed 1,00,000/day
iv) Payer account should have sufficient balance to transfer funds to others.
Balance should exclude minimum required amount to use account. Raise
an error as “Insufficient Funds” if the balance is less.
v) Core logic for fund transfer in the procedure should include in the
transaction management so that false transactions will be rolled back.
vi) Online Transactions should be allowed between 9AM to 7PM on each day
except Sunday-Create Trigger for this condition.
7. Create Stored procedure which will update the customer balance by adding
interest to the principle for every 90 days
i) This procedure will be used to update only balance column of customer
table.
ii) Input values are Duration and Interest Rates
iii) Interest Rates are 3.5%, 4.5, 4.75 and 5% for ‘Salary’,’Saving’, ‘Current’,
and ‘Corporate’ account types respectively – Cursor should be created
here.
8. Create User Defined function to calculate the interest required to pay for all
account holders for the given time
i) Input values are Duration and Interest Rates
ii) Interest Rates are 3.5%, 4.5, 4.75 and 5% for ‘Salary’,’Saving’, ‘Current’,
and ‘Corporate’ account types respectively
iii) Should return scalar value- Which will return the total interest required to
pay for all customers in the bank in the given duration.

Important Notes:
A. Should maintain error handing in all the procedures-use Try/Catch blocks
B. Provide comments for each object while writing scripts

You might also like