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 is the use of “join” in sql server?
How can you manage sql azure security?
Explain what are commit and rollback in sql?
What are subqueries in sql server? Explain its properties.
How to view existing indexes on an given table using sp_help?
What types of replication are supported in sql server?
Do you know what is replace and stuff function in sql server?
What is the difference between Stored Procedures and triggers?
Explain the flow of creating a cube? : sql server analysis services, ssas
What is the difference between DataRow.Delete() and DataRow.Remove()?
Explain about extended stored procedure?
Call by value and call by reference in procedure and function, with NOCOPY.
what are the disadvantages of cursors? : Sql server database administration
How to check if a table is being used in sql server?
Why I am getting "the microsoft .net framework 2.0 in not installed" message?