You are on page 1of 1

Subject: Class 10, Information Technology

Prepared by: Ms. Anjali Nair

ASSIGNMENT - SQL

Consider a table FINANCE with the following data types and data:
Structure of the table:
Field Name Data Type Description
Accno (Primary Key) INT(4) Account Number
Bname VARCHAR(15) Bank Name
Cname VARCHAR(25) Customer Name
LAmount DECIMAL (9,2) Loan Amount
Instalments INT(3) Total number of
instalments
Irate DECIMAL (5,2) Interest Rate
Data in Table:
Accno Bname Cname LAmount Instalments Irate
1 SBI Vikas 750000 142 12
2 ICICI Mann Singh 1580000 252 10
3 PNB Binod 530000 140 8
4 SBI V N Gill 850000 165 10
5 OBC P N Sinha 1200000 210 12.5
6 ICICI K P Mathur 1700000 154 12.5
7 HDFC J N Mittal 1500000 190 9

Write the SQL query commands for the following questions


a) Create a table FINANCE.
b) Insert the records in it from the data given in the above table.
c) Display the Columns Accno, Bname, Cname and LAmount for all the
customers.
d) Display all the details of the customers whose instalments is less than
200.
e) Display the Accno and Cname of customers whose interest rate is equal
to 10.
f) Arrange and display the table sorted in descending order of
Loan amounts.
g) Display the table after deleting the record of a customer named ‘K P
Mathur’.
h) Add another column to the table named ‘Category’ of type CHAR (1).
All Rights Reserved @Bharatiya Vidya Bhavan, Middle East

You might also like