DBA > Job Interview Questions > DB2 INTERVIEW QUESTIONS

What techniques are used to retrieve data from m

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

What techniques are used to retrieve data from more than one table in a single SQL statement?


EXEC SQL                                            
 
   SELECT                                         
      A.EMP_ID 

      ,B.WAGE                                     
    FROM                                            
      Table1 A,                                    
      Table2 B                                 
    WHERE                                           
      A.EMP_ID     = 100001                  
    
END-EXEC.    

This is an example of a simple join query


The two tables has to be linked.

EXEC SQL

SELECT A.EMP_ID, B.WAGE
FROM Table1 A,  Table2 B
WHERE A.EMP_ID = B.EMP_ID


AND A.EMP_ID = 100001
END-EXEC. 

(Continued on next question...)

Other Job Interview Questions