Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Table - Products has number of products as below
Productid ProductName
1
iPhone
2
iPad
3
BlackBerry

Table - SalesPersonProduct has the
below records
Salespersonid
productid
S1
1
S1
2
S1
3
S2
1
S3
2

Write a SQL query that returns the number of sales for each
product

Answer Posted / subbareddy.l

Hi,

This query will give us number of sales product wise


select SPP.Productid,COUNT(SPP.Productid)CC from
SalesPersonProduct SPP inner join products P
ON SPP.Productid=P.Productid
group by SPP.Productid

Thanks,
subbareddy.l

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What should be the fill factor for indexes created on tables? : sql server database administration

1101


What command would you use to add a column to a table in sql server?

1238


What is plan freezing?

913


What are the advantages of stored procedure in sql server?

834


What are different types of join?

1239


Explain the steps needed to create a scheduled job?

886


What is raid and what are different types of raid levels?

1084


Is there any difference between primary key and unique with the not null condition?

891


what is a default tcp/ip socket assigned for sql server? : Sql server database administration

1007


What is temporary stored procedure?

900


How to execute stored procedure and set temp table in sql server?

994


What is a file group?

1020


What is the difference between an index and a unique index?

957


Does sql server 2000 clustering support load balancing?

907


Explain iaas, paas and saas?

90