Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on SQL Question within the SQL forums, part of the Databases category; We have two tables: create table emp ( emp_id int, emp_name varchar(10) ) create table sal ( emp_id int, sal float ) Show all employees who did not receive their ...
|
|||||||
|
|||
|
SQL Question
We have two tables:
create table emp ( emp_id int, emp_name varchar(10) ) create table sal ( emp_id int, sal float ) Show all employees who did not receive their salary...in other words show those emp_names from the 'emp' table whose emp_id does not exist in the 'sal' table. Use joins only. Sub Query is not allowed. |
| The Following 2 Users Say Thank You to anders055 For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: SQL Question
please clear which database u r using and why you want the same using join as usnig NOT IN and subquery you can execute the query with better efficiently.
|
|
|||
|
Re: SQL Question
debasisdas --this not my homework...just an interview question i am trying to solve. This was asked in my last inteview.
sarikagupta -- use any database. These tables are an example. Using subquery would not be more efficient as you would have to select all rows of the sal table in the subquery. select emp_name from emp where emp_id not in (select emp_id from sal) Need to do this using only joins. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question about QTP | SangeethaG | QTP | 4 | 09-12-2008 02:27 AM |
| Question | Manoj.Oracle | Oracle Apps | 2 | 03-10-2008 08:54 AM |
| Question | padmakrishna | Java | 0 | 01-22-2008 04:04 PM |
| SAS Question | abdul99 | Data Warehousing | 0 | 07-19-2007 05:28 PM |
| QTP question? | hetal desai | QTP | 3 | 07-11-2007 03:31 PM |