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 / pradip jain
Himesh is also correct with little change..
select top 1 region,count(*) e
from t2 JOIN t1 ON (t1.eid = t2.eid and
t1.[T-Shirt_Size] = 3)
group by region
order by e desc
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
You want to implement the one-to-many relationship while designing tables. How would you do it?
What is raid? : SQL Server Architecture
Are connections to sql server encrypted?
Can a function call a stored procedure in sql server?
What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?
What is the osql utility?
Data table as parameter in sql server?
What is the difference between indexing and hashing?
Can You Use A Stored Procedure To Provide Data To An Ssrs Report?
What is report server project?
What are the system database in sql server 2005?
Explain what are commit and rollback in sql?
can SSRS reports Cache results?
how to trace the traffic hitting a sql server? : Sql server database administration
Explain what is the purpose of sql profiler in sql server?