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 are a scheduled jobs or what is a scheduled tasks?

496


How to list all schemas in a database?

580


What types of Joins are possible with Sql Server?

551


What are dml triggers and types of dml triggers?

553


What command is used to create a database in the sql server and how?

604






Name the different type of indexes in sql?

533


Why olap is used?

568


What is a matrix in ssrs?

101


how can you attach more than 20 ldf files in sql server

1573


Explain transaction server distributed transaction?

503


When is update_statistics command used?

587


What is master database? : SQL Server Architecture

535


What is tempdb database? : SQL Server Architecture

606


Explain different types of lock modes in sql server 2000?

521


Explain about nested stored procedure?

604