Тёмный

#sql 

Daily life of a Data Engineer
Подписаться 1,7 тыс.
Просмотров 2,3 тыс.
50% 1

Hi All,
My name is Ankit Shrivastava and I am a Data Engineer.
Today this #vlog is regarding #sql
What is the difference between WHERE & AND clause with LEFT/RIGHT join ?
What is happening when we use same condition with WHERE clause & AND clause with JOINS and also I am discussing INNER join + WHERE clause is giving same result with LEFT join + WHERE clause
Is output is going to be same ?
select * from emp e left join dept d on e.dept_id = d.dept_id WHERE e.salary = 1000;
select * from emp e left join dept d on e.dept_id = d.dept_id AND e.salary = 1000;
Please find the DDL for practice:-
create table emp (emp_id int, emp_name varchar(20),dept_id int, salary int);
insert into emp values(100,'Ankit',1,1000);
insert into emp values(101,'Saurabh',1,2000);
insert into emp values(102,'Kushal',2,3000);
insert into emp values(103,'Farhan',2,5000);
insert into emp values(104,'Varun',3,6000);
create table dept (dept_id int, dept varchar(20));
insert into dept values (1,'IT');
insert into dept values (2,'HR');
insert into dept values (3,'SALES');
#sqlinterviewquestionsandanswers #dataanalysts #dataengineering #dataanalysis
Please find the link of my all previous videos:-
#sql How to handle NULL while aggregation | SUM() | AVG() | Data Analyst | Data Engineer |Math calc
Link • #sql How to handle NUL...
#sql Calculate start & end time and average time spent in successful transaction | startup interview
Link • #sql Calculate start &...
#sql to achieve last NOT NULL value from the record | Analytical Function | Data Engg | Data Analyst
Link www.youtube.co....
#sql to identify Top Performing Product every Quarter of each year | Highest sale every quarter
Link www.youtube.co....
#sql Interview Question - Calculate Running Total | Cumulative sum | UNBOUNDED PRECEDING FOLLOWING
Link www.youtube.co....
#sql Interview question - Schedule cricket match between teams and generate points table using SQL
Link lnkd.in/dsM8Pe8B
#sql Interview Questions - All JOINS (INNER, LEFT, RIGHT, FULL OUTER) | JOIN only NULL values
Link lnkd.in/dJttWQBB
#sql Interview Question - What is the difference between COUNT(*), COUNT(1) and COUNT(-1)
Link lnkd.in/dVHMWxKj
#SQL Interview Question - How to delete duplicate record from table
Link lnkd.in/dcVyhC7X
#SQL Interview Question -Second highest salary using dense rank analytical function
Link lnkd.in/daBumQfB
#SQL to pull unique record after combination of column
#SELFJOIN
Link lnkd.in/d6tXYXCv

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

 

11 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 12   
@richajain7793
@richajain7793 Год назад
Good explanation, easy to understand
@dailylifeofadataengineer7742
Thank You Richa
@shuchisahay7446
@shuchisahay7446 Год назад
Nice explanations
@dailylifeofadataengineer7742
Thank You
@anuragkumar-ti1vz
@anuragkumar-ti1vz Год назад
Ankit, could you explain when we are applying Left join with AND condition why AND part will be executed first. As per my understanding, join conditions will be executed from top to bottom. please explain
@dailylifeofadataengineer7742
Hi Anurag, Join condition will execute top to bottom but when we have AND clause then condition with AND clause will execute first, thats how SQL query works. If you still have doubts, let's connect on linkedin to discuss more this www.linkedin.com/in/ankit-shrivastava-5262561a/
@ashishkumarwankhede9692
@ashishkumarwankhede9692 Год назад
Which SQL query is faster? Filter on Join criteria or Where clause? Please give the ans of above question.
@pravin2139
@pravin2139 Год назад
hi Ankit. I'm still confused on left join & and.. what I understood is , ....(emp where emp.salary = 1000) left join dept on emp.dept_id = dept.dept_id.. i.e., partial / subset of emp (i.e left) table joining with entire dept (i.e right) table... is this the case? if s, I'm confused with the result set.
@dailylifeofadataengineer7742
Hi Pravin, Lets connect on linkedin to discuss more this www.linkedin.com/in/ankit-shrivastava-5262561a/
@sundarrajan211
@sundarrajan211 Год назад
Keep support guys
@dailylifeofadataengineer7742
Thank You Sundar
@doctoryoy4447
@doctoryoy4447 5 месяцев назад
Why do you keep asking "OK?" and "Right?" like nobody is there to answer you buddy, you are having a delusion
Далее
Вопрос Ребром - Булкин
59:32
Просмотров 953 тыс.
A small kitten was dumped #cat #kitten #cutecat
00:41
6 SQL Joins you MUST know! (Animated + Practice)
9:47
Просмотров 153 тыс.
MySQL: JOINS are easy (INNER, LEFT, RIGHT)
5:04
Просмотров 393 тыс.
Cursor Is Beating VS Code (...by forking it)
18:00
Просмотров 53 тыс.