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

What do you do in data exploration

947


Explain “not null constraint” in sql server?

981


what number files will a information contain in SQL Server? How many forms of information files exist in SQL Server? How many of those files can exist for a single database?

1013


How to identify current user in ssrs report?

394


Disadvantages of the indexes?

1070


Does view occupy space?

903


How to use subqueries with the in operators in ms sql server?

1032


How can you check the level of fragmentation on a table?

1007


How do I delete a sql server database?

1003


What is RAID? What are the different types of RAID configurations?

1081


how to use DTS package in 2000,2005,2008 in sql server

1803


what is denormalization and when would you go for it? : Sql server database administration

1135


Can sub report data source be different from that of the parent report?

139


can a database be shrunk to 0 bytes, if not, why? : Sql server administration

1145


What is a partition key?

908