Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What keyword you will use to get schema appended to the result set of a ‘for xml’ query?

1008


What is inline table-value user-defined function?

1088


What do you understand by replication in sql server?

1043


Explain in brief how sql server enhances scalability of the database system?

962


What is the difference between executequery () and executeupdate ()?

1007


How to return the date part only from a sql server datetime datatype?

1080


What are the pre-defined functions in the sql server?

1080


What is the difference between stored procedure and user defined functions?

1174


Once setting replication, is it potential to own a publisher as sixty four bit sql server and distributor or subscribers as a thirty two bit sql server?

980


Explain various On-Delete options in a DB table. Which is the default option?

1446


What is the recovery model?

969


What is attribute hierarchy? : sql server analysis services, ssas

998


Differentiate between a local and a global temporary table?

934


What is transact-sql language?

1052


List the different types of collation sensitivities in sql server?

1025