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

Why are you getting errors when creating a new odbc dsn?

0 Answers  


Tell me extended events in sql server 2008?

0 Answers  


What is a scheduled job or what is a scheduled task?

0 Answers  


How to stop log file growing too big?

0 Answers  


What is purpose of normalization?

0 Answers  






Explain the difference between clustered and non-clustered index?

0 Answers  


Tell me what is normalization? Explain different forms of normalization?

0 Answers  


Explain the difference between HTTP and HTTPS in database?

0 Answers   Wipro,


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

6 Answers   Infosys, Value Labs,


This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?

0 Answers   TCS,


What according to you is the difference between mysql and sql server performance?

0 Answers  


What is attribute? : sql server analysis services, ssas

0 Answers  


Categories