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
How do you send email on SQL Server?
Explain forward - only cursors?
Explain sql server authentication modes?
How to view the error log for any specific instance? : sql server database administration
What is log in sql server?
What does the on update no action do?
How can I create a new template for import ? : sql server management studio
Explain the difference between function and stored procedure?
what are the reporting service components in SSRS?
What are cursors stored procedures and triggers?
What is ssl in sql server?
What is hot add cpu in sql server 2008?
What is pessimistic concurrency?
explain what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration
Can you explain different types of joins?