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

Answers were Sorted based on User's Feedback



can any one answer this query,thank you in advance Table 1 has 2 columns: EmployeeId, T shirtsize..

Answer / himesh mistry

select region
from table2 t2 JOIN table1 t1 ON (t1.eid = t2.eid and
t1.size = 3)
group by region

Is This Answer Correct ?    3 Yes 4 No

can any one answer this query,thank you in advance Table 1 has 2 columns: EmployeeId, T shirtsize..

Answer / padmavasireddy

Thnak you karthick and ram

Is This Answer Correct ?    0 Yes 2 No

can any one answer this query,thank you in advance Table 1 has 2 columns: EmployeeId, T shirtsize..

Answer / sandeep narayanan

SELECT B.Region FROM TABLE1 AS A
INNER JOIN TABLE2 AS B ON A.EmployeeID=B.EmployeeID
WHERE A.TShirtSize=3

Is This Answer Correct ?    0 Yes 3 No

can any one answer this query,thank you in advance Table 1 has 2 columns: EmployeeId, T shirtsize..

Answer / manisha

select b.region from table1 as a,table2 as b
where a.employeeid=b.employeeid and a.[tshirt size]=3

Is This Answer Correct ?    0 Yes 7 No

can any one answer this query,thank you in advance Table 1 has 2 columns: EmployeeId, T shirtsize..

Answer / ram

select region from tab2 where empid in(select empid from
tab1 where tshirtsize=3)

Is This Answer Correct ?    1 Yes 10 No

Post New Answer

More SQL Server Interview Questions

Where sql server user names and passwords are stored in sql server? : sql server database administration

0 Answers  


What is the sql server agent?

0 Answers  


how to insert the values in 5 table at a time Using any single statement ?

6 Answers   Infosys, Value Labs,


Explain forward - only cursors?

0 Answers  


What is raid and what are different types of raid levels?

0 Answers  






What is difference between inner join and join?

0 Answers  


What do you understand by check constraint in sql server?

0 Answers  


How does using a separate hard drive for several database objects improves performance right away?

0 Answers  


What is difference in performance between insert top (n) into table and using top with insert?

0 Answers  


What is default constraint?

0 Answers  


Do you know what are acid properties of transaction?

0 Answers  


After removing a table from database, what other related objects have to be dropped explicitly?

0 Answers  


Categories