Tags
Complex SQL Challenges, Complex TSQL Challenge, Interview Qs.SQL SERVER Questions, Interview questions on Joins, Interview Questions on SQL, InterviewQuestions, InterviewQuestions for SQL, Joins, Joins Interview questions, Joins Puzzle, Learn complex SQL, Learn SQL, Learn T-SQL, PL/SQL Challenges, Puzzles, Queries for SQL Interview, SQL, SQL 2012, SQL 2014, SQL 2014 Interview Questions, SQL Challenge, SQL Challenges, SQL Joins, SQL pl/sql puzzles, SQL Puzzles, SQL Queries, SQL SERVER Interview questions, SQL Skills, SQL Sudoku, SQLSERVER, T SQL Puzzles, T-SQL Challenge, Tough SQL Challenges, Tough SQL Puzzles, TSQL, TSQL Challenge, TSQL Challenges, TSQL Interview questions, TSQL Queries
T-SQL Output Query | [ The JOIN Puzzle – Part 1 ]
Please go through the queries and the sample input data and provide the outputs of the query given below.
–Let’s say we have 2 table TestJoinsT1 and TestJoinsT2. Both the tables having only one ID column. Here you have to provide the output of the queries given below
--Please go through the data given above and provide outputs for below queries --Query 1 SELECT t1.ID , t2.ID FROM [dbo].[TestJoinsT1] t1 INNER JOIN [dbo].[TestJoinsT2] t2 ON t1.ID = t2.ID --Query 2 SELECT t1.ID , t2.ID FROM [dbo].[TestJoinsT1] t1 LEFT OUTER JOIN [dbo].[TestJoinsT2] t2 ON t1.ID = t2.ID --Query 3 SELECT t1.ID , t2.ID FROM [dbo].[TestJoinsT1] t1 RIGHT OUTER JOIN [dbo].[TestJoinsT2] t2 ON t1.ID = t2.ID --Query 4 SELECT t1.ID , t2.ID FROM [dbo].[TestJoinsT1] t1 FULL OUTER JOIN [dbo].[TestJoinsT2] t2 ON t1.ID = t2.ID |
Please leave a comment if you need solution to the above puzzle
Keep Learning
Kindly provide the solution.
LikeLiked by 1 person