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 / madhu sudhan g

Hiii

try this query you will get the answer

select count(1) as SalesCount,P.Product from Products P
INNER JOIN SalesPersonProduct S ON S.Id=p.Id group by P.Product

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to make remote connection in database?

956


What does null mean?

940


What is user-defined scalar function?

913


What is side by side migration in sql server?

1023


What are the tools available in market as an alternative to sql server reporting services?

119


How do you check sql server is up and running?

935


What is difference between views and tables?

919


How each E-R model constructs can be mapped to the relational model?

922


What is checkpoint process in the sql server?

965


What is the difference between sdf and mdf?

1236


Why use view instead of a table?

884


Do you know how to store and query spatial data?

984


What number aggregate functions are accessible there in sql?

1009


Does partitioning improve performance?

920


How do you rebuild an identity column?

899