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

Does sql server 2016 have ssms?

1004


How to delete duplicate records based on single column from a table?

1105


What is the difference between for auto and for nested?

1065


What is an expression in ms sql server?

1143


Can a database be shrunk to 0 bytes, if not, why?

1164


How to find tables without indexes?

1155


How to create function with parameter in sql server?

1158


you have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem? : Sql server administration

1010


You have to store user responses of ‘yes’ and ‘no’ what kind of data type is best suited for this task?

991


Do you know what is a trace frag? Where do we use it?

1040


What are relationships and mention different types of relationships in the dbms

1012


What are the different types of collation sensitivity?

1177


How to locate and take substrings with charindex() and substring() functions?

1074


Can we check locks in database? If so, how can we do this lock check?

986


Can you explain what is the use of custom fields in report?

1100