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

How do you send email on SQL Server?

1037


Explain forward - only cursors?

1033


Explain sql server authentication modes?

1110


How to view the error log for any specific instance? : sql server database administration

1017


What is log in sql server?

1123


What does the on update no action do?

999


How can I create a new template for import ? : sql server management studio

1053


Explain the difference between function and stored procedure?

925


what are the reporting service components in SSRS?

163


What are cursors stored procedures and triggers?

986


What is ssl in sql server?

1054


What is hot add cpu in sql server 2008?

913


What is pessimistic concurrency?

953


explain what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration

885


Can you explain different types of joins?

912