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

select top 1 region,count(t2.eid) a
from t2
join t1 on t1.eid=t2.eid
group by region,[T-Shirt_Size]
having [T-Shirt_Size]=3
order by a 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 are dml triggers and types of dml triggers?

716


How can you check the level of fragmentation on a table?

775


What are the different types of data sources in ssrs?

165


Explain throw statement in sql server 2008?

739


what are defaults? : Sql server database administration

700






Can you insert NULL in unique column?

830


How use inner join in sql server?

802


Explain a join?

780


What is the difference between functions and stored procedures?

796


How to test odbc dsn connection settings?

707


how to invoke a trigger on demand? : Sql server database administration

733


What are ddl (data definition language) statements for tables in ms sql server?

751


What are various aggregate functions that are available?

691


What are the advantages of user defined function?

666


What is the downside of using udf?

750