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 / karthick veerappan
select top 1 region,count(*) from table2 where empid in
(select empid from table1 where tsize=3) group by region
order by count(*) desc
| Is This Answer Correct ? | 8 Yes | 5 No |
Post New Answer View All Answers
What is a self join in sql server?
What is sql server 2000 work load governor?
How to delete all rows with truncate table statement in ms sql server?
What is entity data services?
Explain the disadvantages of cursors?
What are examples of triggers?
How to insert new line characters into strings?
How can we remove orphan records from a table?
What is the meaning of resultset type_scroll_insensitive?
What are the events recorded in a transaction log?
How many clustered indexes can be created on a table? I create a separate index on each column of a table. what are the advantages and disadvantages of this approach?
What does set rowcount do?
How to get nth highest salary from employee table.
Is it ok to shrink transaction log?
What are the disadvantages of indexes?