Escolar Documentos
Profissional Documentos
Cultura Documentos
Answers:-
--1)
select * from Customer
where CustomerType=CustomerType
order by CustomerType,customername
--2)
select CustomerType,count(*)
from Customer
where CustomerType=CustomerType
group by CustomerType
--3)
select CustomerType,min(OpeningBalance)
from Customer
where CustomerType=CustomerType
group by CustomerType
--4)
select CustomerType,max(OpeningBalance)
from Customer
where CustomerType=CustomerType
group by CustomerType
--5)
select CustomerType,sum(OpeningBalance)
from Customer
where CustomerType=CustomerType
group by CustomerType
--6)
select CustomerType,avg(OpeningBalance)
from Customer
where CustomerType=CustomerType
group by CustomerType
--7)
select CustomerType,sum(OpeningBalance)
from Customer
group by CustomerType
Having sum(OpeningBalance)>100 and (CustomerType=CustomerType)
--8)
select count(*) as 'number of customers',datename(mm,doj) as
'Month',datename(yy,doj)as 'Year'from customer
where doj=doj
group by datename(mm,doj) ,datename(yy,doj)
--9)
We can get this by table updation only.
--10)
select * from customer
where openingBalance>100 and (openingBalance=openingBalance)
order by openingBalance
Answers :
===============
--select CustomerType,sum(OpeningBalance),count(CustomerType)as
SumOFOpeningBalance from Customer
--group by CustomerType ---reference
from Customer