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
Can we add an identity column to decimal datatype?
How efficient you are in oracle and SQL server?
How to invoke a trigger on demand?
Do you know what are the steps to process a single select statement?
What are the different ways you can create databases in sql server?
What is a derived table?
When I delete any data from a table, does the sql server reduce the size of that table?
If a table does not have a unique index, can a cursor be opened on it?
Do you know what is xpath?
What is normalization? Explain its different types?
Insert syudents details in table.Current system date &time insert into joining time.How do insert?( in sysdate only return current system date how do add time?)
Can we run Reporting Services with SQL Server express edition, which is a free version of SQL Server?
What are tables in sql server?
What is a mutating table error and how can you get around it?
Explain about SQLOS?