GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  SQL Server
Go To First  |  Previous Question  |  Next Question 
 SQL Server  |  Question 43 of 65    Print  
Subqueries vs Joins in SQL
What is the difference between Subqueries and Joins? Which is better and Why? Give an example of each.


  
Total Answers and Comments: 2 Last Update: August 22, 2008     Asked by: t1tankster 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: subbaraovangalli
 
if we want to retrive data from more than one table byusing join conditions then we go to join based on the type type of join condition.
sub query is nested quires there is no need of any join condition

Above answer was rated as good by the following members:
vijay4281
February 11, 2008 05:36:10   #1  
subbaraovangalli Member Since: March 2007   Contribution: 17    

RE: Subqueries vs Joins in SQL
if we want to retrive data from more than one table byusing join conditions then we go to join based on the type type of join condition.
sub query is nested quires there is no need of any join condition

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 2Overall Rating: -1    
August 22, 2008 08:09:42   #2  
sakthi.jaganathan Member Since: August 2008   Contribution: 8    

RE: Subqueries vs Joins in SQL
Join is a Methodology to get a data from more than one table its work under the condition.

Example:

If we want to display the Employee no and his Department no

SELECT Empno Deptno
FROM Emp Dept
where Emp.Deptno Dept.Deptno

subquery it has two select statement the inner select statement will execute first and then it will be the value for outer select statement.


Example:

If we want to display the employees who are getting salary more than an employee TIM

SELECT Ename Sal
FROM Emp
WHERE Sal>(SELECT Sal
FROM Emp
WHERE Ename 'TIM');

 
Is this answer useful? Yes | No

 Related Questions

What is the difference between Subqueries and Joins? Which is better and Why? Give an example of each. 
Latest Answer : Join is a Methodology to get a data from more than one table, its work under the condition. Example: If we want to display the Employee no and his Department no SELECT Empno,Deptno FROM Emp,Dept ...


 Sponsored Links

 
Related Articles

SQL Server 2005 Integration Services Review

SQL Server 2005 Integration Services using Visual Studio 2005 A Beginner s Guide SQL Server 2005 A offering of Microsoft Corporation for database management the SQL server 2005 is one of the powerful database management systems in the world Available for integration in almost any system that uses Mi
 

SQL Server Integration Services

SQL Server Integration Services Here is a sample chapter from Beginners Guide to SQL Server Integration Services Using Visual Studio 2005 by Jayaram Krishnaswamy Environment set up for Visual Studio 2005 with respect to SSIS and multiple tasking Connecting to Microsoft Access Text Files Excel S
 

Web Server

Web Server A web server can be a program or the computer itself which receives the requests from various other browsers and responds to those requests These requests are all requests that are being sent for some documents There are two kinds of web servers available The web server program and the
 

Client-Server Models and N-Tier Applications

Client Server Models and N Tier Applications One of principal objective of Client Server methods is to provide data to an end user However Client Server architectural methodologies are much more complex Client Server describes the process wherein a client program generates contact with a separate se
 

Java and Client Server Models

Java and Client Server Models The Role of Client Servers on the Web Client server models provide the essential mechanisms for working with the Internet In fact most of the World Wide Web is built according to this paradigm In client server models the web browsers run by millions of users are the cli
 

Web Services and Client Server Technology

Web Services and Client Server Technology Introduction to Distributed Computing The Internet and expanded network connectivity established client sever models as the preferred form of distributed computing When talking about Client Server models of networked communication using web services the broa
 

Object-Oriented Client-Server Internet

Object Oriented Client Server Internet OCSI Environments as IT Infrastructure Client Server Basics Object Oriented Client Server Internet OCSI environments provide the IT infrastructure for supporting OCSI applications For our purposes infrastructure refers to operating systems networks middleware
 

N-Tier Client-Server Architecture

N Tier Client Server Architecture Description of 1 Tier and 2 Tier Web Applications This article will discuss the various architectures of Client Server environments Perhaps the most influential Client Server environment is the Internet and its global users With the increasing use of web application
 

Language Enhancements in SQL Server 2005

The T-SQL has been enhanced to include error handling, recursive query and to support the new database engine capabilities. Two new relational operators have been introduced—PIVOT and UNPIVOT for use in the FORM clause query. They perform manipulation on an input table valued expression an
 

Security enhancements in SQL Server 2005

The trustworthy computing initiative has contributed greatly to help microsoft improve customer experience. A number of customer needs on security have been addressed. 1. Restricting user access to sql server 2. Disabling services and restricting service configuration 3. Reducing the surface are aof
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape