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 default constraint in ms sql server?

540


What is an entity-relationship diagram (erd)?

592


Is sql server implemented as a service or an application? : Sql server database administration

514


Explain what is the main purpose of having conversation group?

527


What is the difference between sql server 2000 object owner and sql server 2005 schema? : sql server database administration

599






What is mean by dml?

545


explain the difference between oracle- sql and sql server sql ? if both are same y we r using 2 sw.s?

1991


You want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition?

544


How much memory that we are using in Logshipping Concept?

1370


What is dirty page?

569


What samples and sample databases are provided by microsoft?

579


Tell me about pre-defined functions of sql?

696


What is the command dbcc checkdb used for?

539


Explain the types of indexes.

645


What is attribute? : sql server analysis services, ssas

593