Тёмный

PWC Data Analyst Interview | SQL Intermediate Question 11 

Code-Con
Подписаться 975
Просмотров 13 тыс.
50% 1

Question - Give review for the ids in the tables based on their occurrences in the tables.
DDL Commands -
drop table sources;
drop table targets
create table sources(
sid int,
sname varchar(50)
);
create table targets(
tid int,
tname varchar(50)
);
insert into sources values(1,'A'),(2,'B'),(3,'C'),(4,'D');
insert into targets values(1,'A'),(2,'B'),(4,'X'),(5,'F');
select * from sources;
select * from targets;
#placement #placements #reels #dataanalytics #ml #facebook #instagram #interviewquestions #sql #google #amazon #flipkart #ml #ai #dataengineering

Опубликовано:

 

22 дек 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 15   
@raagpathy
@raagpathy 2 месяца назад
Very nice
@meettoraju
@meettoraju 5 месяцев назад
Hi bro,thanks for sharing this.Please focus on youtube Title,description,thumbnail also..then only will get more views and subscribers.
@vijaygupta7059
@vijaygupta7059 3 месяца назад
same solution as per videos tries in MYSQL select coalesce(sid, tid ) as id , status from (with cte as (Select * from sources left join targets on sources.sid = targets.tid union all Select * from sources right join targets on sources.sid = targets.tid where sid is null ) Select sid, tid ,case when sid is not null and tid is null then "New in Sourse" when sid is null and tid is not null then "New in Target" when sid=tid and snametname then "Missmatch" else "OK" end as status from cte) as a where status"OK"
@Code-Con
@Code-Con 3 месяца назад
Nice one 👏
@poushalinag7942
@poushalinag7942 Месяц назад
My SQL doesn't allow full joins 🙁
@vijaygupta7059
@vijaygupta7059 Месяц назад
@@poushalinag7942 is MYSQL we can do using other method like below its same way work as full join Select * from sources left join targets on sources.sid = targets.tid union all Select * from sources right join targets on sources.sid = targets.tid where sid is null
@anirbanbiswas7624
@anirbanbiswas7624 Месяц назад
@@poushalinag7942 Yes,same issue here
@sandhyawishes
@sandhyawishes 4 месяца назад
I see this approach is more easy than @ankit bansal. Your way of teaching is also good. Subscribed
@Code-Con
@Code-Con 4 месяца назад
Thanks 👍🏾
@blse2000
@blse2000 2 месяца назад
WITH M AS (SELECT S.*,T.* FROM SOURCES S FULL OUTER JOIN TARGETS T ON sid = tid ) SELECT CASE WHEN tid is null then concat(sid,' new in Source') WHEN sid is null then concat(tid,' new in Target') WHEN sname tname then 'Mismatched' else '' END AS result FROM M WHERE tid is null OR sid is null OR sname tname
@muhammadsalar8905
@muhammadsalar8905 5 месяцев назад
I've just started watching the video, I'm hoping the approach to the problem is different from @ankit bansal
@Code-Con
@Code-Con 5 месяцев назад
May be, haven't watched sir's approach till now.
@muhammadsalar8905
@muhammadsalar8905 5 месяцев назад
@@Code-Con You haven't copied ankit bansal, so kudos man, good job & keep making videos like this consistently, subscribed!
@Hkumar_new
@Hkumar_new Месяц назад
Hindi bolo sir.. smjh nhi aata
@Code-Con
@Code-Con Месяц назад
Ok will record in hindi too
Далее
Backstage 🤫 tutorial #elsarca #tiktok
00:13
Просмотров 1,3 млн
Don't Do This, If you have a PS5 in India 😱
11:19
Просмотров 332 тыс.
MySQL: JOINS are easy (INNER, LEFT, RIGHT)
5:04
Просмотров 309 тыс.