You are on page 1of 9

2/22/2015

JOIN : SQL JOIN QUERIES INTERVIEW QUESTIONS AND ANSWERS PDF SET-6 ~ INTERVIEW QUESTIONS PDF

INTERVIEW
QUESTIONS
PDF
HOME

FREE PDF

JOIN : SQL JOIN QUERIES INTERVIEW


QUESTIONS AND ANSWERS PDF SET-6
MS SQL SERVER JOINS RELATED INTERVIEW

QUERIES

Share

Here we come with latest/new sql server joins


queries, as you know joins related queries/questions
are most frequently asked in any database related

Free Oracle
Training

Videos. Subscribe to preview course


via Oracle Learning Streams
youtube.com/oraclelearningstream

interview to puzzle developers. So this set of interview


question contains basic joins related interview question which
can be asked in any company interview, And Company like
TCS/HCL/Infosys/Nagarro mostly asked following type of
queries. So before attend interview be prepare for it. This set
of question is for experienced developers(2-3 years).
Upcoming set will contain more complex joins related interview
questions which you will face time.
I promise you will be surprise to see next set of join queries,
because you will face it first time.
At last you will be able to download all query in pdf format. So
start from basic.

http://www.interviewquestionspdf.com/2014/07/join-sql-join-queries-interview.html

1/9

2/22/2015

JOIN : SQL JOIN QUERIES INTERVIEW QUESTIONS AND ANSWERS PDF SET-6 ~ INTERVIEW QUESTIONS PDF

***********************SQL JOINS RELATED INTERVIEW


QUERIES***********************

--51. Get employee name, project name order by firstname from


"EmployeeDetail" and "ProjectDetail" for those employee which have
assigned project already.
--ANS:

SELECT FirstName,ProjectName FROM [EmployeeDetail] A INNER JOIN


[ProjectDetail] B
ON A.EmployeeID = B.EmployeeDetailID ORDER BY FirstName

--52. Get employee name, project name order by firstname from


"EmployeeDetail" and "ProjectDetail" for all employee even they have
not assigned project.
--ANS:
SELECT FirstName,ProjectName FROM [EmployeeDetail] A LEFT OUTER
JOIN [ProjectDetail] B
ON A.EmployeeID = B.EmployeeDetailID ORDER BY FirstName

--53(35.1) Get employee name, project name order by firstname from


"EmployeeDetail" and "ProjectDetail" for all employee if project is not
assigned then display "-No Project Assigned".
--ANS:
SELECT FirstName, ISNULL(ProjectName,'-No Project Assigned') FROM
[EmployeeDetail] A LEFT OUTER JOIN [ProjectDetail] B
ON A.EmployeeID = B.EmployeeDetailID ORDER BY FirstName
--54. Get all project name even they have not matching any
employeeid, in left table, order by firstname from "EmployeeDetail" and
"ProjectDetail".
http://www.interviewquestionspdf.com/2014/07/join-sql-join-queries-interview.html

2/9

2/22/2015

JOIN : SQL JOIN QUERIES INTERVIEW QUESTIONS AND ANSWERS PDF SET-6 ~ INTERVIEW QUESTIONS PDF

--ANS:
SELECT FirstName,ProjectName FROM [EmployeeDetail] A RIGHT
OUTER JOIN [ProjectDetail] B
ON A.EmployeeID = B.EmployeeDetailID ORDER BY FirstName

--55. Get complete record(employeename, project name) from both


tables([EmployeeDetail],[ProjectDetail]), if no match found in any table
then show NULL.
--ANS:
SELECT FirstName,ProjectName FROM [EmployeeDetail] A FULL OUTER
JOIN [ProjectDetail] B
ON A.EmployeeID = B.EmployeeDetailID ORDER BY FirstName

--56. Write a query to find out the employeename who has not assigned
any project, and display "-No Project Assigned"( tables :[EmployeeDetail],[ProjectDetail]).
--ANS:
SELECT FirstName, ISNULL(ProjectName,'-No Project Assigned') AS
[ProjectName] FROM [EmployeeDetail] A LEFT OUTER JOIN
[ProjectDetail] B
ON A.EmployeeID = B.EmployeeDetailID
WHERE ProjectName IS NULL

--57. Write a query to find out the project name which is not assigned to
any employee( tables :- [EmployeeDetail],[ProjectDetail]).
--ANS:
SELECT ProjectName FROM [EmployeeDetail] A RIGHT OUTER JOIN
[ProjectDetail] B
ON A.EmployeeID = B.EmployeeDetailID
WHERE FirstName IS NULL

--58. Write down the query to fetch EmployeeName & Project who has
assign more than one project.
--ANS:
Select EmployeeID, FirstName, ProjectName from [EmployeeDetail] E
INNER JOIN [ProjectDetail] P
ON E.EmployeeID = P.EmployeeDetailID
WHERE EmployeeID IN (SELECT EmployeeDetailID FROM [ProjectDetail]
GROUP BY EmployeeDetailID HAVING COUNT(*) >1 )

http://www.interviewquestionspdf.com/2014/07/join-sql-join-queries-interview.html

3/9

2/22/2015

JOIN : SQL JOIN QUERIES INTERVIEW QUESTIONS AND ANSWERS PDF SET-6 ~ INTERVIEW QUESTIONS PDF

--59. Write down the query to fetch ProjectName on which more than
one employee are working along with EmployeeName.
--ANS:
Select FirstName, ProjectName from [EmployeeDetail] E INNER JOIN
[ProjectDetail] P
ON E.EmployeeID = P.EmployeeDetailID

Click on the following link for NEXT SET OF QUESTIONS:


CLICK HERE FOR NEST SET (MORE THAN 100 QUERIES)
Sponsored Ads

Question and Answers

Answers
Project

Share

Share This:
Digg

Facebook

Twitter

Google+

Stumble

18:45
INTERVIEW QUESTIONS, SQL INTERVIEW QUERY, SQL SERVER
3 COMMENTS

Recommend this on Google

Related Posts:
COMPLEX JOINS : SQL SERVER JOINS
QUERIES INTERVIEW QUESTIONS AND
ANSWERS EXAMPLES FOR EXPERIENCED SET7
SET-7 COMPLEX JOINS : MS SQL SERVER JOINS QUERIES INTERVIEW QUESTIONS
AND ANSWERS FOR EXPERIENCED WITH EXAMPLES(MORE THAN 3 YEARS) This set
con Read More

SELECT QUERIES: Small Tricky SQL SERVER


Queries Interview Questions and Answers SET9
SET-9 Objective Type :Small Tricky SQL SERVER Queries
Interview Questions and Answers for experienced and fresher Hey

http://www.interviewquestionspdf.com/2014/07/join-sql-join-queries-interview.html

4/9

2/22/2015

JOIN : SQL JOIN QUERIES INTERVIEW QUESTIONS AND ANSWERS PDF SET-6 ~ INTERVIEW QUESTIONS PDF
here I come with tricky sql Read More

GROUP BY : SQL INTERVIEW QUERIES


QUESTIONS AND ANSWERS WITH EXAMPLE
FOR EXPERIENCED SET-5
SQL GROUP BY & HAVING INTERVIEW QUERIES This is 5th post
related to sql interview queries with examples. In this post we will
discuss most importent Read More

DDL : MS SQL SERVER QUERIES INTERVIEW


QUESTIONS FOR EXPERIENCED DEVELOPER
SET-8
DDL RELATED SQL SERVER INTERVIEW QUERIES This set contains
most frequently asked ddl related interview queries, It contains
query related to Identi Read More

JOIN : SQL JOIN QUERIES INTERVIEW


QUESTIONS AND ANSWERS PDF SET-6
MS SQL SERVER JOINS RELATED INTERVIEW QUERIES Here we
come with latest/new sql server joins queries, as you know joins
rela Read More

Newer Post

Home

Older Post

3 comments:
Naresh Sharma 16 September 2014 at
05:32
The query is wrong, the corrected one is:
select P.ProjectName, E.FName
from ProjectDetails P
inner join EmployeeDetails E
on p.EmployeId = E.Id
where
P.ProjectName
in(select
ProjectName from ProjectDetails group by
ProjectName having COUNT(1)>1)
Reply

Vikas

16 September 2014 at 05:55

how it is wrong? U have done it on the


bases of project name,
I have done it on the bases of employed,
main thing is count so here where
condition can differ.
Reply

anzilkhan 16 January 2015 at 06:54


Naresh was mentioning your last query.
Its wrong. Compare it with your first
query, both are same. Please correct.
Reply
http://www.interviewquestionspdf.com/2014/07/join-sql-join-queries-interview.html

5/9

2/22/2015

JOIN : SQL JOIN QUERIES INTERVIEW QUESTIONS AND ANSWERS PDF SET-6 ~ INTERVIEW QUESTIONS PDF

Enter your comment...

Comment as:

Publish

Google Account

Preview

Reliable & Secure-Free 24/7 Support


Free Phone Support, Setup & More

GoDaddy Rs
59 Hosting
Search

in.godaddy.com

SEARCH

SQL Queries
Windows SQL Server
Employee Database

Find us on Facebook

Interviewquestionspdf.com
Like

40 people like Interviewquestionspdf.com.

Facebook social plugin

MUST READ
WHAT IS AN INTERVIEW? :)

Popular Posts
http://www.interviewquestionspdf.com/2014/07/join-sql-join-queries-interview.html

6/9

2/22/2015

JOIN : SQL JOIN QUERIES INTERVIEW QUESTIONS AND ANSWERS PDF SET-6 ~ INTERVIEW QUESTIONS PDF

CHETAN BHAGAT BOOK/NOVEL HALF


GIRLFRIEND FREE DOWNLOAD PDF
HINDI/GUJARATI
FREE DOWNLOAD HALF GIRLFRIEND CHETAN
BHAGAT NEW BOOK/NOVEL 2014 PDF

CHETAN BHAGAT'S HALF GIRLFRIEND HINDI


ONLINE READ EBOOK PDF

MS SQL QUERIES INTERVIEW QUESTIONS ANSWERS


EXAMPLES 4 FRESHER AND EXPERIENCED PDF
SQL SERVER QUERY INTERVIEW QUESTIONS ANSWERS WITH EXAMPLE FOR FRESHER : SET-1
SOLUTION
COMPLEX JOINS : SQL SERVER JOINS QUERIES
INTERVIEW QUESTIONS AND ANSWERS
EXAMPLES FOR EXPERIENCED SET-7
CHETAN BHAGAT HALF GIRLFRIEND FREE
DOWNLOAD +FLIPKART +PDF

Your Dreams are Mine Now PDF FREE


DOWNLOAD? NOW GET HARD COPY FREE!! YES!!

ASP.NET MVC INTERVIEW QUESTION PDF BOOK


FREE BY Shailendra Chauhan

Follow us on Facebook

Blog links

Powered by Blogger.

Blog Archive
2015 (48)
http://www.interviewquestionspdf.com/2014/07/join-sql-join-queries-interview.html

7/9

2/22/2015

JOIN : SQL JOIN QUERIES INTERVIEW QUESTIONS AND ANSWERS PDF SET-6 ~ INTERVIEW QUESTIONS PDF

2014 (138)
December (10)
November (9)
October (5)
September (38)
August (11)
July (19)
Big Data FREE webinar on career opportunities in B...
10000startups.com google initiatives India
CWG 2014 RESULT APPS ANDROID | ITUNES |
WINDOWS
GLASGOW CWG 2014 MEDAL TALLY | HARYANA &
PUNJAB
HARYANA AND PUNJAB AT CWG 2014 GLASGOW
Schedule of Indian players at the CWG Glasgow 2014...
FREE PDF DOWNLOAD : ANKIT FADIA SOCIAL 50
WAYS TO ...
SELECT QUERIES: Small Tricky SQL SERVER Queries
In...
MS SQL QUERIES INTERVIEW QUESTIONS ANSWERS
EXAMPLE...
DDL : MS SQL SERVER QUERIES INTERVIEW
QUESTIONS FO...
COMPLEX JOINS : SQL SERVER JOINS QUERIES
INTERVIEW...
JOIN : SQL JOIN QUERIES INTERVIEW QUESTIONS
AND AN...
Free Download PDF: ASP.Net, C#.Net, ADO.Net, MS SQ...
GROUP BY : SQL INTERVIEW QUERIES QUESTIONS
AND ANS...
SALARY : SQL INTERVIEW QUERIES EXAMPLES FOR
FRESHE...
DATETIME : SQL SERVER QUERIES INTERVIEW FOR
EXPER...
SQL SERVER INTERVIEW QUERY WITH EXAMPLE 4
FRESHER ...
http://www.interviewquestionspdf.com/2014/07/join-sql-join-queries-interview.html

8/9

2/22/2015

JOIN : SQL JOIN QUERIES INTERVIEW QUESTIONS AND ANSWERS PDF SET-6 ~ INTERVIEW QUESTIONS PDF

SQL SERVER QUERY INTERVIEW QUESTIONS ANSWERS WIT...


Import Data from Multiple Excel Files\Folders usin...
June (7)
May (19)
April (19)
February (1)

Get FREE EBOOK in UR mail-box


Enter your email address:

SUBSCRIBE

Delivered by FeedBurner

Live Traffic Feed


A visitor from Toronto, Canada viewed MS
SQL QUERIES INTERVIEW
QUESTIONS ANSWE... 14 secs ago
A visitor from Herndon, United States
Real-time view Get Feedjit

Copyright 2015 INTERVIEW QUESTIONS PDF


Distributed By My Blogger Themes | Blogger Theme By PremiumBloggerTemplates

http://www.interviewquestionspdf.com/2014/07/join-sql-join-queries-interview.html

9/9

You might also like