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 / anil gupta

select region, count(t1.size) from tab1 t1 inner join tab2
t2 on t1.eid = t2.eid where t1.size = 3 group by t2.region
order by count(t1.size) DESC and rownum = 1;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the grouping functions?

702


Does view occupy space?

701


What is set nocount on and what is set nocount off?

670


Which is the main third-party tool used in sql server?

666


What is molap and its advantage? : sql server analysis services, ssas

712






Will the writetext statement activate a trigger?

744


What do you mean by authentication modes in sql server?

774


Explain optimistic and pessimistic concurrency?

725


What type of locking occurs during the snapshot generation? : sql server replication

1084


How will you find out if there are expensive SQL statements running or not?

766


What is a non clustered primary key?

672


how to create a scrollable cursor with the scroll option? : Sql server database administration

770


What is a view in sql?

758


Introduction of rollup clause using sum and group by clause?

705


How to define and use table alias names in ms sql server?

746