Understanding ALL ANY or SOME in SQL || Lesson 89 || DBMS || Learning Monkey ||

  Рет қаралды 49,225

Learning Monkey

Learning Monkey

4 жыл бұрын

Here we will try to discuss Understanding ALL, ANY or SOME in SQL.
Understanding ALL ANY or SOME in SQL
Definitions of ALL, ANY or SOME: ALL, ANY or SOME are keywords. These keywords are used with WHERE or HAVING Clause.
ALL, ANY or SOME operates on the subqueries that return multiple values. ALL returns true if all subquery values meet the condition. ANY or SOME returns true if any of the subquery values meet the condition.
To understand this let's consider the employee table of the company database
Understanding ALL Keyword:
Now consider the query with the use of ALL " SELECT fname FROM employee WHERE salary ALL (20000, 25000, 30000); ".
What do the above query states?
The query is going to find the fname of all the employees whose salary is greater than ALL these values 20000, 25000, and 30000.
How this query works is it takes the salary value in each and every row and is compared with all the values given (20000, 25000, 30000).
If the salary in the row is greater than ALL the values then the fnames will be displayed.
Understanding ANY or SOME Keyword:
Consider the same query used with ANY " SELECT fname FROM employee WHERE salary ANY (20000, 25000, 30000); ".
What do the above query states?
The query is going to find the fname of all the employees whose salary is greater than ANY of these values 20000, 25000, and 30000.
How this query works is it takes the salary value in each and every row and is compared with all the values given (20000, 25000, 30000).
If the salary in the row is greater than ANY the values then the fnames will be displayed.
In place of we can use SOME also.
Example Query on ALL, ANY or SOME:
Find the fnames and lnames of all the employees whose salary is greater than all the employees in department number 5.
In order to execute this query, we have to find the salaries of all the employees in department number 5. Then those values are to be compared with every employee salary.
The answer to the query is " SELECT fname, lname FROM employee WHERE salary ALL (SELECT salary FROM employee WHERE dno = 5); ".
The output of the inner query is the salaries of the employees who are working in department number 5 (30000, 40000, 38000, 25000).
Now every employee's salary is compared with ALL the employee's salary of the department number 5.
If the value of the salary is true for all the values then those fname and lname are considered.
Link for our website: learningmonkey.in
Follow us on Facebook @ / learningmonkey
Follow us on Instagram @ / learningmonkey1
Follow us on Twitter @ / _learningmonkey
Mail us @ learningmonkey01@gmail.com

Пікірлер: 79
@adityakhedekar9669
@adityakhedekar9669 3 жыл бұрын
best video, searched everywhere for understanding the concept of all and any but no-one was better than you. Understood 100%
@LearningMonkey
@LearningMonkey 3 жыл бұрын
Thanks for your wonderful words. It's good to hear that. Have a great learning.
@emmanuelramos5158
@emmanuelramos5158 2 жыл бұрын
Great video, loved your series ! Thanks for sharing !!!
@arvindabd1901
@arvindabd1901 4 жыл бұрын
Very good explanation! Thank you !
@Victoria-dh9jp
@Victoria-dh9jp Жыл бұрын
God bless you, you are a life saviour. Good and clear explication. You are a good teacher sir. Continue teaching 👌
@katchie242
@katchie242 8 ай бұрын
Just perfect!!! Exactly what I have been looking for. Thanks a lot
@yuhmin5365
@yuhmin5365 10 ай бұрын
Great example and Lecture :) Thank you so much!
@nknareshkumar
@nknareshkumar 2 жыл бұрын
Beautiful explanation, thanks for the help mate.
@uwizeyejackson5836
@uwizeyejackson5836 3 жыл бұрын
Thank you very much. Tomorrow I have a class presentation on these particular topics
@ruwanrathnayaka9963
@ruwanrathnayaka9963 2 жыл бұрын
Dear Sir, You are the best teacher I have ever met. Thank you so much for solving a problem that has been a big problem for me. love from Sri Lanka
@LearningMonkey
@LearningMonkey 2 жыл бұрын
Welcome good to hear that
@swathikota
@swathikota 10 ай бұрын
Nice explanation. Searched many training materials to understand ALL and ANY Operators concept, but found this video to have exactly the right amount of information to understand the concept. Great work.
@LearningMonkey
@LearningMonkey 10 ай бұрын
Thank you have a great learning in CSE
@dhilipmaharish
@dhilipmaharish Жыл бұрын
Nice video you have saved my time in understanding this concept
@shaiknafeesaanjum5223
@shaiknafeesaanjum5223 Ай бұрын
Woooaahhh....best video ❤
@LearningMonkey
@LearningMonkey Ай бұрын
Have a great learning in CSE
@redshift3639
@redshift3639 3 жыл бұрын
explanation at 8:58 explains this really well! the three ANDs!
@Gripex
@Gripex 8 ай бұрын
Great work, thank you !
@prathamgenius
@prathamgenius 3 жыл бұрын
Thanks a lot..... U cleared all of my doubts.... Thank u
@LearningMonkey
@LearningMonkey 3 жыл бұрын
Thanks for your feedback.
@SB_Roy_Vlogs
@SB_Roy_Vlogs 8 ай бұрын
Nice video...
@AbdifitahAbdulkadir
@AbdifitahAbdulkadir 2 жыл бұрын
Thanks you, I have searched and watched more videos but this one is completely different and I understand 100% thakns u for ur good expalination and simple example elaboration thakns yu
@LearningMonkey
@LearningMonkey 2 жыл бұрын
Welcome good to hear that
@AbdifitahAbdulkadir
@AbdifitahAbdulkadir 2 жыл бұрын
@@LearningMonkey is there any courses you buy like anad javafX
@prasispoudel7353
@prasispoudel7353 3 жыл бұрын
Very good explanation.
@tarunpatel1457
@tarunpatel1457 3 жыл бұрын
Great sir ..you cleared my doubt🔥🔥
@LearningMonkey
@LearningMonkey 3 жыл бұрын
Have a great learning
@osamanawas1597
@osamanawas1597 3 жыл бұрын
well explained !
@tamilkumarang
@tamilkumarang 2 жыл бұрын
really nice explaination bro
@rutujamane1924
@rutujamane1924 27 күн бұрын
Helpfull
@nitinsharma4121
@nitinsharma4121 Жыл бұрын
Good 👍
@dp921
@dp921 Жыл бұрын
Thanks for the informative video
@pratusaria5113
@pratusaria5113 2 жыл бұрын
it is a good video. Thanks!
@bestchoices7694
@bestchoices7694 3 жыл бұрын
Great work man!!!
@LearningMonkey
@LearningMonkey 3 жыл бұрын
Thank you
@gowthame2001
@gowthame2001 Жыл бұрын
😘🥰
@shreeya4638
@shreeya4638 Жыл бұрын
Very nice video apreciateable
@LearningMonkey
@LearningMonkey Жыл бұрын
Thank you
@mukundacs7154
@mukundacs7154 2 жыл бұрын
Don't keep your channel name anywhere in the below, possible please keep upside anywhere,
@Venus_on_fire
@Venus_on_fire Жыл бұрын
Exellent explanation
@KumarPrince21
@KumarPrince21 3 жыл бұрын
Sir what will be the output if we apply >= All operator instead of only >All ?
@pratyushverma6959
@pratyushverma6959 2 жыл бұрын
It will take all those values which would be greater
@eliy5550
@eliy5550 Жыл бұрын
AWESOME!!
@supileshsukumaran2469
@supileshsukumaran2469 2 жыл бұрын
Hi, SELECT fname, lastname FROM [dbo].[EMPLOYEE] AS E WHERE E.SALARY = ALL (SELECT EM.SALARY FROM EMPLOYEE AS EM WHERE EM.DNAME =5 ) why this returns no data.?
@NishantKadam1201
@NishantKadam1201 5 ай бұрын
What's the use if you put your channel logo right over where the important point is!?
@lakshmann9825
@lakshmann9825 Жыл бұрын
awsm
@vinspatel3944
@vinspatel3944 3 жыл бұрын
Thanks for your hard work
@LearningMonkey
@LearningMonkey 3 жыл бұрын
Hi Vins Patel, Thanks for your feedback.
@tejasporwal2321
@tejasporwal2321 3 жыл бұрын
great work
@LearningMonkey
@LearningMonkey 3 жыл бұрын
Thank You
@satyadharkumarchintagunta3793
@satyadharkumarchintagunta3793 5 ай бұрын
Sir, thank You soo much!
@LearningMonkey
@LearningMonkey 5 ай бұрын
Have a great learning in CSE
@ajinzrathod
@ajinzrathod 3 жыл бұрын
3:08 Kya sahi time pr facebook wala ad dala hai :)
@GameAndCartoonLover
@GameAndCartoonLover 2 жыл бұрын
Good One !!
@withafni135
@withafni135 Жыл бұрын
Thank you!
@NikhilKumarAngadi-sp6is
@NikhilKumarAngadi-sp6is 3 жыл бұрын
Nice explanation
@LearningMonkey
@LearningMonkey 3 жыл бұрын
Thank you
@rocketleague2136
@rocketleague2136 3 жыл бұрын
thanks
@sarika3778
@sarika3778 Жыл бұрын
Thank u anna
@bebeniang1752
@bebeniang1752 Жыл бұрын
Thank you
@divyasingh5612
@divyasingh5612 3 жыл бұрын
Thank you sir
@LearningMonkey
@LearningMonkey 3 жыл бұрын
Welcome, thanks for the feedback.
@kashish9285
@kashish9285 2 жыл бұрын
Hi Sir, very well explained :) Thank you very much! although i have a (silly) question - if ANY and SOME behave in identical manner, why bother having an extra operator called 'SOME'? should be just ALL or ANY. Hope that makes sense :)
@echoecho249
@echoecho249 2 жыл бұрын
good job sir
@LearningMonkey
@LearningMonkey 2 жыл бұрын
Thankyou
@arifulislam1155
@arifulislam1155 Жыл бұрын
tnx💕💕💕💕
@higa4541
@higa4541 Жыл бұрын
Thank you so much sir ❤️🥺
@LearningMonkey
@LearningMonkey Жыл бұрын
Most welcome 😊
@jayasudharajendran5209
@jayasudharajendran5209 2 жыл бұрын
Super
@LearningMonkey
@LearningMonkey 2 жыл бұрын
Thank You
@spacejam75
@spacejam75 Жыл бұрын
This was looking great until the facebook advertisement banner covered the query, making it impossible to follow. So a really good video until about the 3:05 mark, then essentially useless.
@shiamysasa986
@shiamysasa986 8 ай бұрын
Okay, But James and Jennifer do not belong to Dno 5. Could you pls clarify the doubt?
@LearningMonkey
@LearningMonkey 8 ай бұрын
The outer query check the entire table.
@ginnimalik7625
@ginnimalik7625 2 жыл бұрын
It was written that in dept no. 5 so the values of dept no. 5 would also return
@ginnimalik7625
@ginnimalik7625 2 жыл бұрын
Pls answer
@munusamy9347
@munusamy9347 Жыл бұрын
Hi , I have a doubt james and jeniffer not belongs to dno 5
@Kid-vx9uh
@Kid-vx9uh Жыл бұрын
wtf not bad
@ashirkhan445
@ashirkhan445 2 жыл бұрын
not helpful, your facebook ad blocked the query, absurd
@vaishnavis9473
@vaishnavis9473 2 жыл бұрын
Thank you
Nastya and SeanDoesMagic
00:16
Nastya
Рет қаралды 16 МЛН
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 6 МЛН
Scary Teacher 3D Nick Troll Squid Game in Brush Teeth White or Black Challenge #shorts
00:47
Understanding Set Comparison Operator in SQL
11:15
Edredo for Learners
Рет қаралды 35 М.
SQL "difference between" interview questions (part 1)
8:20
Crack Concepts
Рет қаралды 610 М.
We Learn SQL #11 | Subqueries in SQL with operators ANY and ALL
4:19
All, Any and Some Operators in SQL (Hindi) - Lecture #54
18:08
The Crazy Programmer
Рет қаралды 7 М.
How do indexes make databases read faster?
23:25
Arpit Bhayani
Рет қаралды 55 М.
Learn Database Normalization - 1NF, 2NF, 3NF, 4NF, 5NF
28:34
Decomplexify
Рет қаралды 1,8 МЛН
Learn SQL Basics in Just 15 Minutes!
16:57
Kenji Explains
Рет қаралды 129 М.
EXISTS and NOT EXISTS in SQL || Lesson 88 || DBMS || Learning Monkey ||
14:28