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 is the use of “join” in sql server?

1020


How can you manage sql azure security?

101


Explain what are commit and rollback in sql?

867


What are subqueries in sql server? Explain its properties.

968


How to view existing indexes on an given table using sp_help?

1055


What types of replication are supported in sql server?

999


Do you know what is replace and stuff function in sql server?

943


What is the difference between Stored Procedures and triggers?

1037


Explain the flow of creating a cube? : sql server analysis services, ssas

1005


What is the difference between DataRow.Delete() and DataRow.Remove()?

1168


Explain about extended stored procedure?

866


Call by value and call by reference in procedure and function, with NOCOPY.

1247


what are the disadvantages of cursors? : Sql server database administration

974


How to check if a table is being used in sql server?

904


Why I am getting "the microsoft .net framework 2.0 in not installed" message?

916