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 / avaneesh bajoria

select top 1 t2.region , count(t1.tsize) as co from tsize
t1,region t2
where t1.empid = t2.empid
group by t2.region,t1.tsize
having t1.tsize = 3 order by co desc

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to insert stored procedure result into temporary table?

574


what is a mixed extent? : Sql server administration

598


How many types of triggers are there?

568


What are exact numeric data types in ms sql server?

508


What is sleeping status in sql server?

516






Explain about the command-line tool SQLCMD?

545


What are key constraints?

510


Can group functions be mixed with non-group selection fields in ms sql server?

535


Can You Use A Stored Procedure To Provide Data To An Ssrs Report?

109


How to return the date part only from a sql server datetime datatype?

571


How to recover from sql injection? : sql server security

519


What is the difference between varchar and varchar types?

557


What are the steps you can take to avoid “deadlocks”?

518


what is memory-optimized nonclustered indexes

551


what are statistics, under what circumstances they go out of date, how do you update them? : Sql server database administration

498