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
What should be the fill factor for indexes created on tables? : sql server database administration
What command would you use to add a column to a table in sql server?
What is plan freezing?
What are the advantages of stored procedure in sql server?
What are different types of join?
Explain the steps needed to create a scheduled job?
What is raid and what are different types of raid levels?
Is there any difference between primary key and unique with the not null condition?
what is a default tcp/ip socket assigned for sql server? : Sql server database administration
What is temporary stored procedure?
How to execute stored procedure and set temp table in sql server?
What is a file group?
What is the difference between an index and a unique index?
Does sql server 2000 clustering support load balancing?
Explain iaas, paas and saas?