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 / pradip jain
Himesh is also correct with little change..
select top 1 region,count(*) e
from t2 JOIN t1 ON (t1.eid = t2.eid and
t1.[T-Shirt_Size] = 3)
group by region
order by e desc
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is default constraint in ms sql server?
What is an entity-relationship diagram (erd)?
Is sql server implemented as a service or an application? : Sql server database administration
Explain what is the main purpose of having conversation group?
What is the difference between sql server 2000 object owner and sql server 2005 schema? : sql server database administration
What is mean by dml?
explain the difference between oracle- sql and sql server sql ? if both are same y we r using 2 sw.s?
You want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition?
How much memory that we are using in Logshipping Concept?
What is dirty page?
What samples and sample databases are provided by microsoft?
Tell me about pre-defined functions of sql?
What is the command dbcc checkdb used for?
Explain the types of indexes.
What is attribute? : sql server analysis services, ssas