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 / pradip jain

Himesh is also correct with little change..

select top 1 region,count(*) e
from t2 JOIN t1 ON (t1.eid = t2.eid and
t1.[T-Shirt_Size] = 3)
group by region
order by e desc

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

You want to implement the one-to-many relationship while designing tables. How would you do it?

938


What is raid? : SQL Server Architecture

1151


Are connections to sql server encrypted?

985


Can a function call a stored procedure in sql server?

939


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

1083


What is the osql utility?

940


Data table as parameter in sql server?

1019


What is the difference between indexing and hashing?

1142


Can You Use A Stored Procedure To Provide Data To An Ssrs Report?

143


What is report server project?

145


What are the system database in sql server 2005?

1026


Explain what are commit and rollback in sql?

909


can SSRS reports Cache results?

147


how to trace the traffic hitting a sql server? : Sql server database administration

1844


Explain what is the purpose of sql profiler in sql server?

1050