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 options are there to delete rows on the publisher and not on the subscriber? : sql server replication

777


List out what other servers you can use with ssrs?

99


What is the difference between left and right outer join?

621


what are the different types of SSRS reports?

116


Characterize join and name diverse sorts of joins?

612






Does full backup break log chain?

628


What is difference between rownum and row_number?

604


What are wait types?

663


What stored by the master? : sql server database administration

653


What is the difference between writing data to mirrored drives versus raid5 drives

578


what types of replication are supported in sql server? : Sql server database administration

560


What are the database roles? : sql server security

647


What is the use of =,==,=== operators?

678


How to select true false based on column value in sql server?

592


What is difference between commit and rollback when used in transactions?

576