99 percent of the time you can solve a problem using an independent query with a combination of cte and window functions. As the correlated sub queries are not so performance always try to avoid them. If you are looking to learn SQL from basic to advanced with lots of practice material and projects do consider my 0 to hero SQL course : www.namastesql.com/courses/SQL-For-Analytics-6301f405e4b0238f71788354
@jayselokar7 ай бұрын
also correlated is more time consuming
@UnrealAdi7 ай бұрын
Hi @ankitbansal6, the script provided don't match with the result set of the emp table! Fixing it may be useful. Also, thanks for the incredible content as usual!
@shivammishra-mk9jp14 күн бұрын
I saw multiple videos on this topic, but trust me guy's no one can simplify the lang. or concept other than Mr. Ankit Bansal. Respect you sir for a reason 🙏🙏 thanks a lot❤
@DEEPAK-jx5si7 ай бұрын
Here is my Solution select * from (select *, avg(salary) over(partition by department_id ) as avg_dep_sal from emp) e where e.avg_dep_sal < e.salary
@vandanaK-mh9zo7 ай бұрын
why we need subqueries: when the required format of the data is not given/not available, then we need to derive it and the join it back with the main data. Independent Subquery - 1. it can be run independently 2. it runs only once Correlated Subquery - 1. It cannot run independently because it has the reference of the main query 2. it runs for every record of the main query
@prajjwaljaiswal34197 ай бұрын
Best video in internet till now explaining the difference
@gazart85577 ай бұрын
Excellent
@avi80167 ай бұрын
Great explanation 💯 Would you like more videos like this where you cover important topics. Thankyou!!😊
@ankitbansal67 ай бұрын
Sure 😊
@parth_pm167 ай бұрын
Solution using "AVG(salary) over ()" Solution: select * from (select * ,avg(salary) over(partition by department_id) avg_dep_salary from emp_6_dec) s where salary>avg_dep_salary
@ayyappansriАй бұрын
Ultimate explanation ❤
@ankitbansal6Ай бұрын
Thanks a lot 😊
@sandipansarkar92117 ай бұрын
finished watching
@Shri-RAM-JaiBajrangBali7 ай бұрын
Hi Ankit, Please also explain inline queries..
@navneethks86773 ай бұрын
Very Helpful 🫂🫂
@alkalisblaze7 ай бұрын
Hey @ankitbansal6, you missed a paranthesis ')' in your insert statement while inputting for Ankit's entry.
@ankitbansal67 ай бұрын
Thanks 🙏
@ritudahiya62237 ай бұрын
@ankit bansal please tell for analytics point of view which platform is better for practicing sql.. Leetcode or data lemur?
@ankitbansal67 ай бұрын
DataLemur
@anjibabumakkena7 ай бұрын
Hi Ankit, Can You explain Performance tuning.
@ankitbansal67 ай бұрын
Sure
@chiranjeevic83847 ай бұрын
Hi Ankit, is the PLSQL concepts like stored procedures, triggers important for a data engineer ? If it's important, can you pls make a vedio on it ?
@ankitbansal67 ай бұрын
Not so important
@tumusaikarthik66327 ай бұрын
Mostly core sql is used 95% the select queries
@vinodpaluvuri547 ай бұрын
Hi Ankit, can you let us know when to use correlated subquery.
@ankitbansal67 ай бұрын
Check my pinned comment
@shruthi.hshruthi39657 ай бұрын
Hi @ankitbansal6 i m new to sql can anyone explain why cant we use select department_id ,avg(salary) as avgsal from emp groupby department_id having salary> avg(salary)
@hamzarahman77637 ай бұрын
if you want to solve this way you should Learn Self Join first... Hint: you have to separate avg(salary) into different intermediate table, because code don't know whats is avg(salary)..
@suriyas63383 ай бұрын
Hey, To know this, please get the understanding of sql order of execution. You'll be able to understood