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
Explain about Joins?
What is the meaning of sql server?
How to insert data with null values?
What is the advantage of sql server?
What is bookmark link in ssrs?
Explain ms sql server reporting services vs crystal reports?
Explain what is raid and what are different types of raid levels?
What is the difference between varchar and varchar types?
What is inner join? Explain with an example?
Explain the concept of view and Types of views in SQL server?
what’s the difference between Covering Indexes and Clustered Indexes ? how to use clustered index small ?
What are the different SQL Server Versions you have worked on?
A trigger can reference objects outside the current database? State true or false.
How do you size a resultset?
What is the difference between char and varchar2 datatype in sql?