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 are ddl (data definition language) statements for tables in ms sql server?
What is a linked server in sql server?
Is it possible to replicate data from sql server to oracle? : sql server replication
Describe the left outer join & right outer join. : sql server database administration
What are three major types of constraints?
Name 3 ways to get an accurate count of the number of records in a table?
What is surrogate key? : sql server analysis services, ssas
How to replace the Query Result 'Null Value' with a text ?
Can we shrink data file in sql server?
What are the differences between char and nchar in ms sql server?
What is the Difference Between Primary and Foreign Key?
What are the five major components of a dbms?
How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?
What is the optimization being performed in oracle and SQL Server?
What is the largest component inside a field?