0% found this document useful (0 votes)
78 views

Create Table Loan (Lid Number (3), Amount Number (10,2), Emi Number (10,2), Branch Varchar2 (10) )

This document contains a series of SQL queries on a loan table: 1) It defines a loan table with fields for loan ID, amount, monthly installment (EMI), and branch. 2) The queries find details like the number of records, loans over $50k, loans from branches starting with "V", minimum/maximum loan amounts, total/average EMIs, and more. 3) It displays specific rows like the first, last, or first three rows in different orders.

Uploaded by

Praneeth Ch
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views

Create Table Loan (Lid Number (3), Amount Number (10,2), Emi Number (10,2), Branch Varchar2 (10) )

This document contains a series of SQL queries on a loan table: 1) It defines a loan table with fields for loan ID, amount, monthly installment (EMI), and branch. 2) The queries find details like the number of records, loans over $50k, loans from branches starting with "V", minimum/maximum loan amounts, total/average EMIs, and more. 3) It displays specific rows like the first, last, or first three rows in different orders.

Uploaded by

Praneeth Ch
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

create table loan(lid number(3),amount number(10,2),emi


number(10,2),branch varchar2(10));
select * from loan;
LID
AMOUNT
EMI BRANCH
---------- ---------- ---------- ---------11
10000
1100 vizag
77
70000
7100 guntur
22
20000
2100 eluru
99
90000
9100 vizag
55
50000
5100 guntur
66
60000
6100 vizag

2 .Find the number of records in the table loan


3. Find the number of loans whose amount>50000
4. Find the number of loans whose branch name starts with v
5. Find the smallest loan amount
6.
7.
8.
9.

Find
Find
Find
Find

the
the
the
the

largest loan amount


sum of all emis
average of all emis
average of all emis from vizag branch

10. Find the average of emis for all branches


11. Find the branches and avg emis whose average emis>2500
12. Find the average of emis for all the branches whose name conatins the
letter u
13. Display the first row of the loan table
14. Display the first three rows of the loan table
15. Display the first three rows of the loan table in the order of lids
16. Find the last row number of the table loan
17. Display all the rows except the last row from the table loan
18. Display the last row of the table loan

You might also like