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
Explain what is lock escalation and what is its purpose?
What is 4nf in normalization form?
What do you understand by coalesce in sql server?
What is dbcc updateusage?
Explain what stored procedure sp_replcounters is used for? : sql server replication
explain what is raid and what are different types of raid configurations? : Sql server database administration
What is the difference between TRUNCATE and DROP?
What are the advantages of sql stored procedure?
Do you know spatial data types - geometry and geography in sql server 2008?
What is trigger and different types of Triggers?
How to execute stored procedure and set temp table in sql server?
What do you understand by a view? What does the with check option clause for a view do?
What are the instances when triggers are appropriate?
what is the Ticketing tool used in Wipro technologies at Bangalore...???
What do you mean by a Composite primary key?