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
Does sql server 2016 have ssms?
How to delete duplicate records based on single column from a table?
What is the difference between for auto and for nested?
What is an expression in ms sql server?
Can a database be shrunk to 0 bytes, if not, why?
How to find tables without indexes?
How to create function with parameter in sql server?
you have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem? : Sql server administration
You have to store user responses of ‘yes’ and ‘no’ what kind of data type is best suited for this task?
Do you know what is a trace frag? Where do we use it?
What are relationships and mention different types of relationships in the dbms
What are the different types of collation sensitivity?
How to locate and take substrings with charindex() and substring() functions?
Can we check locks in database? If so, how can we do this lock check?
Can you explain what is the use of custom fields in report?