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
What do you do in data exploration
Explain “not null constraint” in sql server?
what number files will a information contain in SQL Server? How many forms of information files exist in SQL Server? How many of those files can exist for a single database?
How to identify current user in ssrs report?
Disadvantages of the indexes?
Does view occupy space?
How to use subqueries with the in operators in ms sql server?
How can you check the level of fragmentation on a table?
How do I delete a sql server database?
What is RAID? What are the different types of RAID configurations?
how to use DTS package in 2000,2005,2008 in sql server
what is denormalization and when would you go for it? : Sql server database administration
Can sub report data source be different from that of the parent report?
can a database be shrunk to 0 bytes, if not, why? : Sql server administration
What is a partition key?