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 the difference between substr and charindex in the sql server?
What are user-defined functions (udfs) in sql server?
What stored procedure would you use to view lock information?
Difference Between ORDER BY Clause and GROUP BY Clause in SQL?
What is the most common trace flags used with sql server?
Why should one not prefix user stored procedures with ‘sp_’?
Explain important index characteristics?
You want to implement the one-to-one relationship while designing tables. How would you do it?
How many categories of data types used by sql server?
What is difference between order by and group by?
What are distinctive joins find as a part of sql?
How can a database be repaired?
Explain Geometry datatype in sql server 2008 with example
What is the difference between system objects and user objects?
What does sql server mean?