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 / lakram5455
SELECT a.Region FROM
(SELECT TOP(1) a.TSize, COUNT(a.EId) AS TotalCount, b.Region
FROM emp a INNER JOIN Region b ON b.EId = a.EId WHERE TSize
= 3 GROUP BY a.TSize, b.Region ORDER BY TotalCount DESC) a
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are partitioned views and distributed partitioned views?
What is ms sql server reporting services?
What do you understand by a view?
What do we have to check in database testing?
List the different types of collation sensitivities in sql server?
How to enable/disable indexes?
how will add additional conditions in sql?
What to check if a User database is locked?
What stored by the tempdb ? : sql server database administration
Mention what are the core components of ssrs?
What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?
What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?
What are the requirements to use odbc connections in php scripts?
What is the use of sql profiler in sql server 2012?
Explain “@@rowcount” and “@@error” in sql server?