Tags

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,


T-SQL Output Query | [ The JOIN Puzzle – Part 3 ]

–Let’s say we have 2 table TestJoins3 and TestJoins4. Both the tables having only one ID column. Here you have to provide the output of the queries given below. Before that please go through the input data below.

5

6


--

--Query 1
SELECT t1.ID , t2.ID FROM [dbo].[TestJoins3] t1 INNER JOIN [dbo].[TestJoins4] t2  ON t1.ID = t2.ID

--Query 2
SELECT t1.ID , t2.ID FROM [dbo].[TestJoins3] t1 LEFT OUTER JOIN [dbo].[TestJoins4] t2  ON t1.ID = t2.ID

--Query 3
SELECT t1.ID , t2.ID FROM [dbo].[TestJoins3] t1 RIGHT OUTER JOIN [dbo].[TestJoins4] t2  ON t1.ID = t2.ID

--Query 4
SELECT t1.ID , t2.ID FROM [dbo].[TestJoins3] t1 FULL OUTER JOIN [dbo].[TestJoins4] t2  ON t1.ID = t2.ID

--

Please leave a comment if you need solution to the above puzzle

Keep Learning

Advertisements