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 do you run a trace?
What are commit and rollback in sql?
We are updating a field in sql and alter the row also.after giving the commit command the system is crashed.what will happen to the commands given,whether it will update and alter the table or not?
How do I view a trc file?
What is DCL?
Can you get second highest salary from the table?
Explain the collation?
How to use clusters?
What are user-defined functions (udfs) in sql server?
What type of locking occurs during the snapshot generation? : sql server replication
Explain how does the report manager work in ssrs?
Explain where clause?
What is cursors? And what are the different types of cursor?
What is RAID? What are the different types of RAID configurations?
What is the difference between NOROW and LOCKROW?