In this video, we will solve a common SQL interview question asked at Indium Technologies — finding match combinations using self-join. Learn how to use self-joins effectively to compare rows within the same table and uncover meaningful pairings.
Script:
-- Create the table
CREATE TABLE teams (
team_name VARCHAR(50) NOT NULL
);
-- Insert team names
INSERT INTO teams (team_name) VALUES
('CSK'),
('KKR'),
('GT'),
('DC'),
('LSG');
TIMESTAMP
00:00 Introduction
00:20 Problem Statement
02:09 Problem Solving Approach
04:26 Finding the expected output
08:36 Writing Final SQL Query
SQL Series for Beginners: https://www.youtube.com/watch?v=JFnF9J8tJcI&list=PLU8R7xIwX9dCoPfosGA5HQ8mHdsHetUTU&index=4
Solve more company-focused SQL Questions here - https://www.youtube.com/watch?v=gfbR5DOMraE&list=PLU8R7xIwX9dBmUEBq-rwUSE6n60K6nYrs
#sql #sqlinterview #dataanlysis #sqltutorial