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
select top 1 region,count(t2.eid) a
from t2
join t1 on t1.eid=t2.eid
group by region,[T-Shirt_Size]
having [T-Shirt_Size]=3
order by a desc
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the latest version of microsoft sql server?
How to get @@error and @@rowcount at the same time?
explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration
Explain about Normalization?
Mention the 3 ways to get a count of the number of records in a table.
Tell me about joins in database system and explain each in detail.
What happens if null values are involved in string operations?
Define Unique Key?
Which tools are available to manage SQL Azure databases and servers?
How to create user messages with print statements in ms sql server?
What happens if null values are involved in comparison operations?
What is report snapshot in ssrs?
You want to implement the one-to-many relationship while designing tables. How would you do it?
How to stop log file growing too big?
What are Row versions of DataRow?