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 / karthick veerappan

select top 1 region,count(*) from table2 where empid in
(select empid from table1 where tsize=3) group by region
order by count(*) desc

Is This Answer Correct ?    8 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between substr and charindex in the sql server?

1003


What are user-defined functions (udfs) in sql server?

937


What stored procedure would you use to view lock information?

905


Difference Between ORDER BY Clause and GROUP BY Clause in SQL?

1010


What is the most common trace flags used with sql server?

965


Why should one not prefix user stored procedures with ‘sp_’?

987


Explain important index characteristics?

985


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

913


How many categories of data types used by sql server?

969


What is difference between order by and group by?

958


What are distinctive joins find as a part of sql?

912


How can a database be repaired?

925


Explain Geometry datatype in sql server 2008 with example

921


What is the difference between system objects and user objects?

1103


What does sql server mean?

975