Full Outer Join in Depth Tutorial | Advanced SQL Tutorial

preview_player
Показать описание
In this video we will discuss in depth full outer join in SQL and its challenges. We will also see 2 better alternatives of full outer join specially when you need to join more than 2 tables.
00:00 setting up the context
03:35 Challenges with full outer join
16:40 alternative 1 (traditional)
23:15 alternative 2 (super cool trick)

scripts:
create table product_master
(
product_id int,
product_name varchar(100)
);

insert into product_master values(100,'iphone5'),(200,'hp laptop'),(300,'dell laptop');

create table orders_usa
(
order_id int,
product_id int,
sales int
);
create table orders_europe
(
order_id int,
product_id int,
sales int
);

create table orders_india
(
order_id int,
product_id int,
sales int
);
--delete from orders_india
insert into orders_usa values (1,100,500);
insert into orders_usa values (7,100,500);
insert into orders_europe values (2,200,600);
insert into orders_india values (3,100,500);
insert into orders_india values (4,200,600);
insert into orders_india values (8,100,500);

Zero to hero(Advance) SQL Aggregation:

Most Asked Join Based Interview Question:

Solving 4 Trick SQL problems:

Data Analyst Spotify Case Study:

Top 10 SQL interview Questions:

Interview Question based on FULL OUTER JOIN:

Playlist to master SQL :

Rank, Dense_Rank and Row_Number:

#sql #fullouterjoin #unionall
Рекомендации по теме
Комментарии
Автор

Please give a thumbs up 👍 to the video if you really like the video.

My next zero to hero live SQL bootcamp starting August 1st. Check out the link below for a detailed curriculum and register your seat.

ankitbansal
Автор

Thanks for the video. I used a similar approach for solving this.

with cte as (
select *, 'e' as region from orders_europe
union
select *, 'i' from orders_india
union
select *, 'u' from orders_usa
)

select product_id
, sum(case when region = 'u' then sales end) as sales_usa
, sum(case when region = 'e' then sales end) as sales_europe
, sum(case when region = 'i' then sales end) as sales_india
from cte
group by product_id

reachrishav
Автор

i can say this is a really advanced concept which comes from experience truly. I faced similar question in Data Analyst interview of Target and was thrown out for even saying outer join :) and I asked chat GPT same question and it answered pretty well/ Find uncommon records from two tables, join two different tables and remove duplicated entries, Get all the Matched and Unmatched Rows From one Table, fetch unmatching records from two SQL tables,

payalbhatia
Автор

It is so amazing which I have learned in this video especially the last trick to handle the null. And I would like to Thank you a lot because due to your channel I have learned tips and trick to solve the queries and made my self ready to write the complex queries. It's the best channel to learn SQL.

kritikagupta
Автор

Ankit you have beautifully interlaced concepts, slowly and methodically increased the pitch in each way that you've solved this problem. It is simply awesome. Excellent example of story telling BIIIIG Thanks Bro

naveen
Автор

Hi Ankit, just wanted to say thank you for all your hard work. You are doing an amazing job.

gqcglsf
Автор

Mind Blowing explanation and last 1-2 mins were the best..
However, Iwould have approached the problem in similar way.. but a great explanation of fullouter and left join and product master use

Datapassenger_prashant
Автор

Today i was so excited that i have really learned a new and different advanced concepts bro... with this i have done with this playlist of thanks for youtube for introducing such a talented persons who can make sql from hard to simple for me and all who are using this style for their careers from ankit bro.. keeep going broooo.💯💯💯💯💯💯💯💯

nikhilreddy
Автор

Enjoyed learning this super cool trick ankit sir and very excited to learn new things from the upcoming videos.

RohitKumar-xkjw
Автор

Wowww!! Such a knowledgeable video, worth waiting till the end and understanding the whole concept.❤

Datapassenger_prashant
Автор

Very efficient and optimized trick.
Thanks Ankit

zeeshanaziz
Автор

Hi Ankit. Awesome video.. I have a query, If we have millions of record in tables then union will efficiently or outer join will work in optimized way ?

udaybhansingh
Автор

Thanks mate.
I have a question
Why does your intro sound like you are fully stoned??? 😂😂😂

toulasantha
Автор

Hello Sir. I'm following your videos for a month. I can see a lot of improvement in problem-solving. However, I still need to ask a question. Let's say I complete your complex question playlist. Would that be enough for me to recognise patterns and have mastery over SQL interview-type questions?
Thank you, Sir

kamalkrsnadas
Автор

Hi Ankit sir, can i used this question and make a LinkedIn post.?

swapnildhivar
Автор

Sir, Can you please tell us genuine Way to get a job as a Data Analyst. We have enough skills and Projects stil not getting Interview calls. Can you help us and talk about this in video.

ajinkya
Автор

Hi Ankit I enrolled for your Python course. Before enrolling it was mentioned you will cover how to build data warehouse and ETL data pipelines with python. None of it is present in your course. How can we contact your support team? I joined the course specifically for that concept and its not there. Please let me know how to contact your supoort team

ritzysquad