Okay
Okay
#21. Create a new table (order ID, customer Name, and order Date) by joining
two tables (order ID, customer ID, and order Date) and (customer ID, customer
#22. Create a foreign key in one of the two tables mentioned above
#23. Find the min, max, sum, and average of the marks in a student marks table.
#24. Find the total number of customers from each country in the table
(customer ID, customer Name, country) using group by.
#25. Create a new table (name, date of birth) by joining two tables (student id,
name) and (student id, date of birth).
#26. Write a SQL query to order the (student ID, marks) table in descending order
of the marks.
ASSIGNMENT -1
Q1) Create the database loans.
Q6) Display the details of all the loans with less than 40 installment.
Q7) Display the accno. and loan amount of all the loans started before 01-04-
2009
Q8) Display the Int_rate of all the loans started after 01-04-2009.
Q9) Display the details of the loans whose rate of interest is null.
Q10)Display the details of all the loans whose rate of interest is not null.
Q11)Display the number of installment of various loans from the table account.
A loan should be appear only once.
Q12) Display the number of installment of various loans from the table account.
An installment should be appear only once
Q14)Display the cust_name and loan_amount for all the loans which donot have
number of installment 36
Q15)Display the cust_name and loan_amount of all the loans for which the loan
amount is less than 500000 or int_rate is more than 12
Q16)Display the details of loans which started in the year 2009.
Q17)Display the details of all the loans whose loan_amount is in the range
400000 to 500000
Q18) Display the details of all the loans whose int_rate is in the range 11% to
12%
Q19) Display the cust_name and loan_amount of all the loans for which the
number of installments are 24,36,48
Q20) Display the details of all the loans whose loan_amount is in the range
400000 to 500000.
Q21) ) Display the details of all the loans whose int_rate is in the range 11% to
12%.
Q22) Display the accno,cust_name,and loan_amount of all the loans for which
cust_name ends with “Sharma”
Q23) Display the accno,cust_name,and loan_amount of all the loans for which
cust_name ends with “a”.
Q24) Display the accno,cust_name,and loan_amount of all the loans for which
cust_name contain with “a”.
Q27)Display the details of all the loans in ascending order of their loan amount.
Q28) Display the details of all the loans in descending order of their start date.
Q29) Display the details of all the loans in ascending order of their loan amount
and within loan amount in the descending order of the start date.
Q30) Put the intrest rate 11.5% for all the loans for which intrest rate is null.
Q31) Increase intrest rate by 0.5% for all the loans for which the loan amount is
more the 400000.
Q32) For each loan replace intrest (loan amount*int rate *installment)12*100.
Q33) Delete the record of all the loans who start date is before 2007.
Q34) delete the record of all the loans of k.p. jain.
Q36)Display the sum of loan amount whose int rate is greater than 10 .
Q38)Display the count of all loan holder whose name ends with Sharma.
Q39) Display the count of all loan holder whose int.rate is null
Q41) Display the interest wise detail of loan account with atleast 10 installment
remaining
ASSIGNMENT-2
Q)Consider the following table homework and write answers for below given
questions:
ASSIGNMENT 3
Q) Consider the following table named GYM with details about fitness products
being sold in the store.
b) Display the names of all the products with unit price less than Rs.20000.
c) Display the details of all the products with unitprice in range 20000 to
30000.
e)
f) Change the unit price data of all the rows by applying a 10% increased
on all the products.
Ans)
h) Display the details of all the products with manufacturer name starting
with A.