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
What are the properties of the transaction?
If any stored procedure is encrypted, then can we see its definition in activity monitor?
If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?
How do I find the sql server version?
How raid can influence database performance?
How to rebuild the master database?
What is clustered index
Explain “row_number()” in sql server with an example?
List out the different types of locks available in sql server?
What is acid mean in sql server?
What are different types of constraints?
List the ways in which dynamic sql can be executed?
What is normalization and what are the advantages of it?
Where can you add custom error messages to sql server?
What is self contained sub query?