Banking System
Banking System
(
custid VARCHAR(6),
fname VARCHAR(30),
mname VARCHAR(30),
ltname VARCHAR(30),
city VARCHAR(15),
mobileno VARCHAR(10),
occupation VARCHAR(10),
dob DATE,
CONSTRAINT customer_custid_pk PRIMARY KEY(custid)
);
custid VARCHAR(6),
bid VARCHAR(6),
loan_amount INT(7),
CONSTRAINT loan_customer_custid_bid_pk PRIMARY KEY(custid,bid),
CONSTRAINT loan_custid_fk FOREIGN KEY(custid) REFERENCES customer(custid),
CONSTRAINT loan_bid_fk FOREIGN KEY(bid) REFERENCES branch(bid)
);
---------------------------------------
Problem #1:
Write a query to display the customer number , firstname, customer�s date of
birth . Display in a sorted order of date of birth year and within that sort by
firstname.
Problem #2:
Write a query to display customer�s number, first name and middle name. The
customer�s who don�t have middle name, for them display the last name. Give the
alias name as Cust_Name.
Problem#3:
Write a query to display account number, customer�s number, customer�s
firstname,lastname,account opening date.
Problem # 4:
Write a query to display the number of customer�s from Delhi. Give the count an
alias name of Cust_Count.
Problem # 5:
Write a query to display the customer number, customer firstname,account number
for the customer�s whose accounts were created after 15th of any month.
Problem # 6:
Write a query to display the female customers firstname, city and account number
who are not into business, service or studies.
Problem # 7:
Write a query to display city name and count of branches in that city. Give the
count of branches an alias name of Count_Branch.
Problem # 8:
Write a query to display account id, customer�s firstname, customer�s lastname for
the customer�s whose account is Active.
Problem # 9:
Write a query to display the customer�s number, customer�s firstname, branch id and
loan amount for people who have taken loans.
Problem # 10:
Write a query to display customer number, customer name, account number where the
account status is terminated.
----------------------------------------------
Problem#1:
Write a query to display the total number of withdrawals and total number of
deposits being done by customer whose registration is C00001. Give the count an
alias name of Trans_Count.
Problem # 2:
Write a query to display the customer�s number, customer�s firstname, customer�s
city and branch city where the city of the customer and city of the branch is
different.
Problem # 3:
Write a query to display the customer number, customer firstname, customer lastname
who has taken loan from more then 1 bank.
Problem # 4:
Write a query to display the number of client who have asked for loans but they
don�t have any account in the bank though they are registered customers. Give the
count an alias name of Count.
Problem # 5:
Write a query to display account id, and total amount deposited by each account
holder ( Including the opening balance ). Give the total amount deposited an alias
name of Deposit_Amount.
Problem # 6:
Write a query to the count the number of customers who have registration but no
account in the bank.
Give the alias name as Count_Customer.
Problem # 7:
Write a query to display citywise, branchwise count of accounts. For the branch
where we don�t have any records display 0.
Problem # 8:
Write a query to display the customer�s firstname who have more then 1 account.
Problem # 9:
Write a query to display the customer�s firstname who have multiple accounts
atleast in 2 banks.
Problem # 10:
Display the customer number, customer name, account number and number of
transactions being made by a customer. Give the alias name for number of
transactions as Count_Trans
------------------------------
Problem # 11:
Write a query to display the account number who has done the highest transaction.
For example the account A00023 has done 5 transactions i.e. suppose 3 withdrawal
and 2 deposits. Whereas the account A00024 has done 3 transactions i.e. suppose 2
withdrawals and 1 deposit. So account number of A00023 should be displayed.