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
How to make remote connection in database?
What does null mean?
What is user-defined scalar function?
What is side by side migration in sql server?
What are the tools available in market as an alternative to sql server reporting services?
How do you check sql server is up and running?
What is difference between views and tables?
How each E-R model constructs can be mapped to the relational model?
What is checkpoint process in the sql server?
What is the difference between sdf and mdf?
Why use view instead of a table?
Do you know how to store and query spatial data?
What number aggregate functions are accessible there in sql?
Does partitioning improve performance?
How do you rebuild an identity column?