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 is an inner join?
What is database replication? What are the different types of replication you can set up in sql server?
What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?
How to Insert multiple rows with a single insert statement?
How do I open a .db file?
How do you rename a table in sql server?
Explain what stored procedure sp_replcounters is used for? : sql server replication
What do you understand by hotfixes and patches in sql server?
What are joins in sql and what are the different types of joins?
Explain can you implement data mining in ssrs?
whats the maximum size of view state??
Explain syntax for viewing, dropping and disabling triggers?
What is key set driven?
What the class forname () does?
How to see the event list of an existing trigger using sys.trigger_events?