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
What are data driven subscriptions?
How to use group functions in the select clause in ms sql server?
When is the use of update_statistics command?
What is a trigger and its types?
Is sql server difficult to learn?
What is row_number function?
What is the use of group by clause?
Explain sql server service broker?
Comment,Datatypes are unlimited
How to get the number of affected rows?
What is SQL Server?
What is 2nf example?
What is the difference between DATETIME2 and DATETIME?
Explain concepts of analysis services?
What the difference between UNION and UNIONALL?