Database Task
Database Task
student(id,name,address,per,email)
5 records
Ans:
Task 2:
book(bid,banme,author,price,publish_year);
Ans:
set price='1000',bname='java'
where bid=1;
2)delete query:
Ans:
delete
from Book
where bid=3;
output:
2. customer table:
Ans:
Select sum(lamt)
loan.lno=cl.lno;
output:
2. calculate average
Ans:
Select Avg(lamt)
loan.lno=cl.lno;
3. calculate maximum loanamount:
Ans:
Select max(lamt)
loan.lno=cl.lno;
output:
ans:
Select min(lamt)
loan.lno=cl.lno;
output:
4.calculate count loanamount:
Ans:
Select count(lamt)
loan.lno=cl.lno;
output:
Ans:
From customer,loan,cl
loan.lno=cl.lno and
lamt> 1000000;
output:
6. Find details of all customers whose loan is less than 10 lakhs & they
are from shirdi city.
Ans:
From customer,loan,cl
loan.lno=cl.lno and
Output:
From customer,loan,cl
loan.lno=cl.lno and
Output:
Ans:
From customer,loan,cl
loan.lno=cl.lno and
Output:
9.List all customers whose name starts with 'ba'.
Ans:
From customer,loan,cl
customer.cno=cl.cno and
loan.lno=cl.lno ;
Output:
Ans:
From customer,loan,cl
customer.cno=cl.cno and
loan.lno=cl.lno ;
Output:
11.List all customers whose name starts with 'a' and ends with 'a'.
Ans:
From customer,loan,cl
customer.cno=cl.cno and
loan.lno=cl.lno ;
output:
Ans:
From customer,loan,cl
customer.cno=cl.cno and
loan.lno=cl.lno ;
Output:
13.List all customers whose name contains only 5 characters.(_____)
Ans:
From customer,loan,cl
customer.cno=cl.cno and
loan.lno=cl.lno ;
Output:
Ans:
From customer,loan,cl
loan.lno=cl.lno and
city='nagar' order by cname desc
Output: