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

sql questions

my sql practical questions

Uploaded by

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

sql questions

my sql practical questions

Uploaded by

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

Q1.

Consider a database LOANS with the following table:

Table: LOANS

Answer the following questions.

1. Create the database LOANS.


2. Use the database LOANS.
3. Create the table Loans and insert tuples in it.
4. Display the details of all the loans.
5. Display the AccNo, Cust_Name, and Loan_Amount of all the loans.
6. Display the details of all the loans with less than 40 instalments.
7. Display the AccNo and Loan_Amount of all the loans started before 01-04-2009.
8. Display the Int_Rate of all the loans started after 01-04-2009.
9. Display the details of all the loans whose rate of interest is NULL.
10. Display the details of all the loans whose rate of interest is not NULL.
11. Display the amounts of various loans from the table LOANS. A loan amount should appear only once.
12. Display the number of installments of various loans from the table LOANS. An instalment should appear only
once.
13. Display the details of all the loans started after 31-12-2008 for which the number of instalments are more than
36.
14. Display the Cust_Name and Loan_Amount for all the loans which do not have number of instalments 36.
15. Display the Cust_Name and Loan_Amount for all the loans for which the loan amount is less than 500000 or
int_rate is more than 12.
16. Display the details of all the loans whose Loan_Amount is in the range 400000 to 500000.
17. Display the details of all the loans whose rate of interest is in the range 11% to 12%.
18. Display the Cust_Name and Loan_Amount for all the loans for which the number of installments are 24, 36, or
48.
19. Display the AccNo, Cust_Name, and Loan_Amount for all the loans for which the Cust_Name ends with 'Sharma'.
20. Display the AccNo, Cust_Name, and Loan_Amount for allthe loans for which the Cust_Name ends with 'a'.
21. Display the AccNo, Cust_Name, and Loan_Amount for allthe loans for which the Cust_Name contains 'a'.
22. Display the AccNo, Cust_Name, and Loan_Amount for allthe loans for which the Cust_Name does not contain
'P'.
23. Display the AccNo, Cust_Name, and Loan_Amount for allthe loans for which the Cust_Name contains 'a' as the
second last character.
24. Display the details of all the loans in the ascending order of their Loan_Amount.
25. Display the details of all the loans in the descending order of their Start_Date.
26. Put the interest rate 11.50% for all the loans for which interest rate is NULL.
27. Increase the interest rate by 0.5% for all the loans for which the loan amount is more than 400000.
28. For each loan replace Interest with (Loan_Amount*Int_Rate*Instalments) /12*100.
29. Delete the records of all the loans whose start date is before 2007.
30. Delete the records of all the loans of 'K.P. Jain'
31. Add another column Category of type CHAR(1) in the Loan table
32. Display the sum of all Loan Amount for whose Interest rate is greater than 10
33. Display the Maximum Interest from Loans table
34. Display the count of all loan holders whose name is ending with ‘Sharma.
35. Display the count of all loan holders whose Interest is Null.

You might also like