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

What are the properties of the transaction?

1069


If any stored procedure is encrypted, then can we see its definition in activity monitor?

1064


If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?

1041


How do I find the sql server version?

1099


How raid can influence database performance?

1114


How to rebuild the master database?

1160


What is clustered index

1083


Explain “row_number()” in sql server with an example?

1073


List out the different types of locks available in sql server?

1045


What is acid mean in sql server?

1237


What are different types of constraints?

995


List the ways in which dynamic sql can be executed?

1083


What is normalization and what are the advantages of it?

1054


Where can you add custom error messages to sql server?

1203


What is self contained sub query?

1138