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

List the advantages of using stored procedures?

649


What does it mean to manipulate data?

661


What is use of @@ spid in sql server?

771


What is the difference between migration and upgradation in sql server?

685


Can you name some of the dml commands in sql?

648






How can you transfer data from a text file to a database table? Or how can you export data from a table to a comma delimited (csv) file? Or how can you import data from ms access to a table in a database? Or how can you export data from a table to an excel file?

663


What is sql injection and why is it a problem? : sql server security

646


What is a covering index?

631


What types of Joins are possible with Sql Server?

642


Can group by and orderby be used together?

680


What is a self join in sql server?

688


What is a unique index?

605


Explain steps of normalization?

623


What is normalization of database?

678


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

685