SQL - PRACTICE QUESTIONS – 1 of 2
AccNo     Cust_Name            Loan_Amt      Instalment     Int_rate         Start_date
    1         R.K. GUPTA           300000        36             12.00            2009-7-19
    2         S.P. SHARMA          500000        48             10.00            2008-03-22
    3         K.S. DHALL           300000        36             NULL             2007-03-08
    4         S.P. SINHA           800000        60             10.00            2008-12-06
    5         S.P. SINHA           200000        36             12.50            2010-01-03
    6         S.P. SHARMA          700000        60             12.50            2008-06-05
    7         K.S. DHALL           500000        48             NULL             2008-03-05
1. Display the details of all the loaners.
2. Display the accno, cust_name and loan_amt of all the loaners.
3. Display the details of all the loaners with less than 40 instalments.
4. Display the accno and loan amount of all the loaners started before 01-04-2009.
5. Display the int_rate of all the loaners started after 01-04-2009.
6. Display the details of all the loaners whose rate of interest is 12.50.
7. Display the details of all the loaners whose rate of interest is not 12.50.
8. Display the different (unique) loan_amount of various loans.
9. Display the number of instalments of various loans.
10. Display the details of all loans started after 31-12-2008 for which the no of
    instalments are more than 36.
11. Display cust_name and loan amount for all the loaners for which the loan amount is
    less than 500000 or int_rate is more than 12.
12. Display the details of all the loans whose loan amount is in the range 400000 to
    500000.
13. Display the details of all the loans whose rate of interest is in the range 11% to 12%
14. Display the cust_name and loan amount for all loans for which the number of
    instalments are 24, 36 or 48.
15. Display accno, cust_name and loan amount for the loans for which the cust_name
    ends with 'SHARMA'.
16. Display accno, cust_name and loan amount for all the loans for which cust_name
    ends with 'a'.
17. Display accno,cust_name and loan amount for all the loans for which cust_name
    contains 'a'.
18. Display accno, cust_name and loan amount for all the loans for which cust_name
    does not contains 'P'.
19. Display accno,cust_name and loan amount for all the loans for which cust_name
    contains ‘a’ as second last character.
20. Display the details of all the loaners in the ascending order of their loan amount.
21. Display the details of all the loans in the descending order of their start_date.
22. Display the details of all the loaners in ascending order of their loan amount and
    descending order of their start_date.
23. Display the highest and lowest loan amount.
24. Display the number of records in the table.
25. Display the sum and average of all the loan amounts.
26. Display the sum of loan amounts of each customer along with customer name.
27. Display the sum of loan amounts for each interest rate along with interest rate.
28. Display the sum of interest for each customer.
29. Display the number of loans taken by each customer.
30. Display the number of loans taken by “S.P. SINHA”.
31. Display the sum of loan amounts for each interest rate of loans having more than 40
    instalments.
32. Delete the records of all the loans whose start date is before 2007.
33. Delete the records of all the loans of ‘K.S. DHALL’.
 ****************************************************************************************
                                 SQL - PRACTICE QUESTIONS – 2 of 2
    1. A department is considering to maintain their worker data using SQL to store the
        data. As a database administer, Karan has decided that :
        Name of the database - Department
        Name of the table - WORKER
        The attributes of WORKER are as follows:
        WORKER_ID - character of size 3
        FIRST_NAME – character of size 10
        LAST_NAME– character of size 10
        SALARY - numeric
        JOINING_DATE – Date
        DEPARTMENT – character of size 10