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 / susanna

select top 1 Count(r.Empid) as Ct,r.regionId from Emp_Region
r inner join Emp_Tshirt t on r.Empid= t.EmpId
where t.T_size=3 group by r.regionId order by Ct 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 do you understand by replication in sql server? Mention the different types of replication in sql server.

701


If the job running very slow what is the action you do

1606


What objects does the fn_my_permissions function reports on? : sql server security

754


Explain what is raid and what are different types of raid levels?

710


Detail about query optimizer?

801


What does it mean to normalize a database and why would you do it?

728


How to modify the underlying query of an existing view?

749


What is the name of the system variable that returns the number of rows affected by a SQL statement?

773


How to attach adventureworkslt physical files to the server?

823


What is nolock?

749


What is the difference between a function and a trigger?

769


Explain how you can deploy an SSRS report?

122


What the different components of Replication and what is their use?

764


What are the Advantages of using CTE in sql server?

773


What is the difference between resultset and resultsetmetadata?

710