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
Give an example of SQL injection attack ?
What is the command used to recompile the stored procedure at run time?
How to execute a sql statement using odbc_exec()?
what is difference between view and Dip.
How to backup SQL Server Reporting Services ?
What do you understand by sql server agent?
What is bit data type?
What is data source view or dsv? : sql server analysis services, ssas
do views contain data ?
What is the tcp/ip port on which sql server runs?
How many types of triggers are there?
How can you stop stored procedures from recompiling?
You are doing log shipping due to some reasons it is failing. How you will proceed from there
What is xml datatype?
What is the difference between a primary key and a unique key? Are they the same?