ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
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 

 Question Submitted By :: Padmavasireddy
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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
# 1
select region from tab2 where empid in(select empid from 
tab1 where tshirtsize=3)
 
Is This Answer Correct ?    0 Yes 3 No
Ram
 
  Re: 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
# 2
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 ?    0 Yes 0 No
Karthick Veerappan
 
 
 
  Re: 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
# 3
Thnak you karthick and ram
 
Is This Answer Correct ?    0 Yes 0 No
Padmavasireddy
 
  Re: 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
# 4
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 2 No
Manisha
 
  Re: 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
# 5
select top 1 t2.region , count(t1.tsize) as co from tsize 
t1,region t2
	where t1.empid = t2.empid
	group by t2.region,t1.tsize
	having t1.tsize = 3 order by co desc
 
Is This Answer Correct ?    0 Yes 0 No
Avaneesh Bajoria
 
  Re: 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
# 6
select region
from table2 t2 JOIN table1 t1 ON (t1.eid = t2.eid and 
t1.size = 3)
group by region
 
Is This Answer Correct ?    0 Yes 1 No
Himesh Mistry
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What is a stored procedure?  3
What are the type of joins? When do we use Outer and Self joins?  3
What is the diff between Static Queries and Dynamic queries give me some examples CSC1
how to find nth highest salary  21
can you any body tell me suppose database is suspect mode. how can take to normal? Teledata1
Advantages and Disadvantages of Cursor? Zenith4
i need some interview questions on sql server developer plz any onee send some links.  1
Explain the architecture of SQL Server?  2
Name three version of sql server 2000 and also their differences?  1
What are the advantages of using sql server over ms access or why should one use sql instead of ms access Impetus1
How can I create a plain-text flat file from SQL Server as input to another application?  2
What is the difference between distinct clause and group by clause? Value-Labs1
What is a Stored Procedure?  5
What are the different ways of moving data/databases between servers and databases in SQL Server? HCL2
can you any body tell me the how to decrease the logfile  2
how to implement locking in sql server Satyam1
When do you use SQL Profiler?  2
What is the difference between windows authentication and sql server authentication HCL3
What are the two virtual tables SQL Server maintains for triggers?  2
What is deadlock and how to avoid the deadlocks. Wipro2
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com