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...

can any one answer this query,thank you in advance

Table 1 has 2 columns: EmployeeId, T shirtsize(values can
be 1,2,3)
Table 2 has 2 columns: EmployeeId, Region
Write SQL to Find the region which has the largest number
of people with Tshirt size=3

Answer Posted / lakram5455

SELECT a.Region FROM
(SELECT TOP(1) a.TSize, COUNT(a.EId) AS TotalCount, b.Region
FROM emp a INNER JOIN Region b ON b.EId = a.EId WHERE TSize
= 3 GROUP BY a.TSize, b.Region ORDER BY TotalCount DESC) a

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are partitioned views and distributed partitioned views?

979


What is ms sql server reporting services?

997


What do you understand by a view?

939


What do we have to check in database testing?

970


List the different types of collation sensitivities in sql server?

980


How to enable/disable indexes?

1016


how will add additional conditions in sql?

1017


What to check if a User database is locked?

1021


What stored by the tempdb ? : sql server database administration

1008


Mention what are the core components of ssrs?

296


What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?

1130


What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?

842


What are the requirements to use odbc connections in php scripts?

1063


What is the use of sql profiler in sql server 2012?

843


Explain “@@rowcount” and “@@error” in sql server?

1009