GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Mainframe  >  DB2
Go To First  |  Previous Question  |  Next Question 
 DB2  |  Question 58 of 198    Print  
What is the difference between IN subselects and EXISTS subselect?
If there is an index on the attributes tested an IN is more efficient since DB2 uses the index for the IN. (IN for index is the mnemonic).


  
Total Answers and Comments: 2 Last Update: January 11, 2007   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 01, 2007 13:33:53   #1  
Vipin Sharma        

RE: What is the difference between IN subselects and E...
IN is used for simple join queries but exists is used in correlated join queries generally both are used as a filter for searching.
 
Is this answer useful? Yes | No
January 11, 2007 23:50:42   #2  
saibabu Member Since: January 2007   Contribution: 14    

RE: What is the difference between IN subselects and E...

hi vipin sharma

IN subselects can also uesd in corelated sub queries.

IN subselects needs to specify the vlues u want to search.

EXISTS subselects doesn't need any to specify values . it searches for existance of return values from the select statement if exists the where commits to true and gives the output.


 
Is this answer useful? Yes | No

 Related Questions

A subselect is a select which works in conjunction with another select. A nested select is a kind of subselect where the inner select passes to the where criteria for the outer select.  

Group by controls the presentation of the rows, order by controls the presentation of the columns for the results of the SELECT statement.  
Latest Answer : Group By forms Groups (of course), but this means it also SORTS; but it will also retrieve a DISTINCT RECORD SETORDER BY Sorts by the columns included in the Statement, and does not retrieve DISTINCT Records.Neither determines the order of the columns ...

What is the cascade rule and how does it relate to deletions made with a subselect. The cascade rule will not allow deletions based on a subselect that references the same table from which the deletions are being made?

Static sql is hard-coded in a program when the programmer knows the statements to be executed. For dynamic sql the program must dynamically allocate memory to receive the query results.  

Compare a subselect to a join. Any subselect can be rewritten as a join, but not vice versa. Joins are usually more efficient as join rows can be returned immediately, subselects require a temporary work area for inner selects results while processing the outer select.

If there is an index on the attributes tested an IN is more efficient since DB2 uses the index for the IN. (IN for index is the mnemonic).  
Latest Answer : hi  vipin sharma,IN subselects  can also uesd in corelated sub queries.IN subselects  needs  to specify  the vlues u want to search.EXISTS    subselects  doesn't need any to specify values . it searches ...

Latest Answer : The Checkpening is referential integrity is in doubt or its check constraints are violated. To remove need to run CHECK data utility.Copy pending - LOAD places a table space in the copy pending status. to remove need to take the backup on a table ...

Latest Answer : DIFFERENCE BETWEEN SPUFI AND QMF : SPUFI : 1.you can execute more queries at a time. 2. In SPUFI result of the query will be in PS or in PDS member will store but3.you know the sqlcode after executing the query. QMF: 1.you cannot execute more than ...

Latest Answer : hi folks,collection: set of packages with a collection idversion: it refers to a package created at a particular time.(ie) if the same package is created at a later time with no changes it will be a different version. there are two options for version ...
Read Answers (3) | Asked by : javid

Latest Answer : DIFFERENCE BETWEEN DYNAMIC(interactive) and STATIC(embedded) SQL :The difference is the time at which the BIND occurs.In static mode, the bind is done prior to the execution and is stored in a PLAN. In dynamic mode, the BIND occurs at execution time.This ...
Read Answers (1) | Asked by : krishna


 Sponsored Links

 
Related Articles

What is difference between call by value and call by reference in function?

The arguments passed to function can be of two types 1. Values passed 2. Address passed The first type refers to call by value and the second type refers to call by reference. For instance consider program1 main() { int x=50, y=70; interchange(x,y); printf(“x=%d y=%d”,x,
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

Mainframe Features

Mainframe Features In this Mainframe tutorial you will learn about features of Mainframe Processing power memory capacity performance computing multiple operating system time sharing reliability serviceability availability clustering technology and other features available in Mainframe mosgoogle cen
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

Difference between Scholarship and Grant

Difference between Scholarship and Grant While both scholarships and grants allow students to pay for their tuition without having to pay the money back there are a number of key differences between the two Knowing the difference between grants and scholarship will make it much easier for students t
 

HR Interview - HR Interview Mistakes You Will Want To Avoid

HR Interview Mistakes You Will Want To Avoid The job interview can be a stressful process This is especially true for those who are going after a competitive position Your nonverbal communication combined with the answers you give during the interview will determine if you are hired mosgoogle While
 

HR Interview - Behavioral HR Interviews

Behavioral HR Interviews As the name implies a behavioral interview is an interview that is held by a human resources department to determine if an applicant has the behaviors that are appropriate for a job The company must know how an applicant will behave in a certain situations mosgoogle The logi
 

HR Interview - How To Prepare For Your HR Interview

How To Prepare For Your HR Interview Before you begin thinking about how you are going to dress for the interview it is important to do your research first You should learn everything you can about the company you wish to work for When you have detailed information about your employer you will conve
 

HR Interview - Telephone Interview Etiquette

Telephone Interview Etiquette When you conduct a telephone interview for a job it is important to show the proper etiquette Not only is it important it is critical is you wish to be hired by the company There are a number of things you will want to do and other things should never be done mosgoogle
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape