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

How you can get a list of all the table constraints in a database? : Sql server administration

1030


List some major differences between triggers and stored procedures?

942


What is the process of normalising?

1001


What are the different types of Indexes available in SQL Server?

1010


What do you understand by coalesce in sql server?

1079


What are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?

1048


Explain atomicity?

1063


How to set database to be single_user in ms sql server?

1038


What is a data collection table?

1014


What is logshipping and its purpose?

994


Define indexes?

1050


What are the main differences between #temp tables and @table variables and which one is preferred?

1088


What is the syntax to execute the sys.dm_db_missing_index_details?

1030


What is the difference between functions and scalar functions?

1215


Can we hide the definition of a stored procedure from a use?

1228