Complex SQL Questions for Interview Preparation

This playlist contains scenario based SQL problems. After solving these you should be able to ace any SQL interview. As and when I find a good problem, i will add it to this playlist.

Curated by: Ankit Bansal (96 videos)


Currently Playing: Can You Solve This Hard SQL Question😢😢 | Parent Child Hierarchy | Recursive CTE

In this video we will discuss a very interesting SQL question which involves parent child hierarchy and we need to use recursive CTE to flatten it. Want to solve more challenging questions : https://www.namastesql.com/coding-problems scripts: CREATE TABLE Politician ( pname VARCHAR(10) PRIMARY KEY, party CHAR(1) ); CREATE TABLE Company ( cname VARCHAR(10) PRIMARY KEY, revenue INT ); CREATE TABLE Invested ( pname VARCHAR(10), cname VARCHAR(10) ); CREATE TABLE Subsidiary ( parent VARCHAR(10), child VARCHAR(10) ); -- Politicians INSERT INTO Politician (pname, party) VALUES ('Don', 'R'), ('Ron', 'R'), ('Hil', 'D'), ('Bill', 'D'); -- Companies INSERT INTO Company (cname, revenue) VALUES ('C1', 110), ('C2', 30), ('C3', 50), ('C4', 250), ('C5', 75), ('C6', 15); -- Investments INSERT INTO Invested (pname, cname) VALUES ('Don', 'C1'), ('Don', 'C4'), ('Ron', 'C1'), ('Hil', 'C3'); -- Subsidiary relationships INSERT INTO Subsidiary (parent, child) VALUES ('C1', 'C2'), ('C2', 'C3'), ('C2', 'C5'), ('C4', 'C6'); Zero to hero(Advance) SQL Aggregation: https://youtu.be/5Ighj_2PGV0 Most Asked Join Based Interview Question: https://youtu.be/xR87ctOgpAE Solving 4 Trick SQL problems: https://youtu.be/Ck1gQrlS5pQ Data Analyst Spotify Case Study: https://youtu.be/-YdAIMjHZrM Top 10 SQL interview Questions: https://youtu.be/Iv9qBz-cyVA Interview Question based on FULL OUTER JOIN: https://youtu.be/KQfWd6V3IB8 Playlist to master SQL : https://youtube.com/playlist?list=PLBTZqjSKn0IeKBQDjLmzisazhqQy4iGkb Rank, Dense_Rank and Row_Number: https://youtu.be/xMWEVFC4FOk #sql #dataengineer


Tracks in this Playlist