Oracle SQL Assignment - 5
Oracle SQL Assignment - 5
ASSIGNMENT 4:
Prerequisite: Create the basic structure using DDL and DML statement as shown in exercise:
Classification: Internal
CUST_DOB DATE,
);
BRANCH_ID VARCHAR(6),
BRANCH_NAME VARCHAR(30),
BRANCH_CITY VARCHAR(30),
);
AC_NUMBER VARCHAR(6),
CUST_ID VARCHAR(6),
BRANCH_ID VARCHAR(6),
OPEN_BALANCE NUMBER,
AC_OPEN_DATE DATE,
AC_TYPE VARCHAR(10),
AC_STATUS VARCHAR(10),
);
TRAN_NUMBER VARCHAR(6),
AC_NUMBER VARCHAR(6),
TRAN_DATE DATE,
MIDIUM_OF_TRAN VARCHAR(20),
TRAN_TYPE VARCHAR(20),
TRAN_AMOUNT NUMBER,
);
Classification: Internal
CUST_ID VARCHAR(6),
BRANCH_ID VARCHAR(6),
LOAN_AMOUNT NUMBER,
);
Expected Result:
Expected Result:
--------------- ---------------
pune 1
Chennai 1
Requirement 4: Query to Display Customer name in given format along with loan amount
a. Display customer name first name , middle name ,last name as shown in expected
result
b. If middle name is not present then print ‘—’ in place of middle name
Expected Result:
Requirement 5: Query to Display Customer Name and the account details in given format
a. Display customer first name , type of transaction and number of transaction
Classification: Internal
Expected Result:
Name Transaction Type Number OF Transaction
Avinash Withdrawal 1
Avinash Deposit 2
Ramesh Withdrawal 3
Ramesh Deposit 3
Amit Withdrawal 1
Amit Deposit 2
Requirement 6: Query to display branch name and total number of account present in that
branch
Expected Result:
Mandvi 2
Delhi cant 1
Classification: Internal
Mahim 1
Vile parle 1
Requirement 7: Query to display customer information who are having loan on their
Bank account
a. Display first name ,middle name ,last name , mobile number for the customer
b. Display first name middle name and last name
c. Assign as message ‘not assigned ‘if middle name is not in database
d. Display mobile number in given format (444-656-9898)
Expected Result:
First Name Middle Name Last Name Contact number
Ramesh Chandra Sharma 954-431-9834
Avinash Sunder Minha 987-765-3210
Abhishek not assigned Dutta 985-561-9876
Shankar not assigned Nair 876-654-8907