✨Link to my SQL e-book: imojo.in/rkajq9 ✨Link to 'Switch your career easily' e-book: imojo.in/1FL7KaG (Perfect for anyone willing to switch to a completely new field or to a different company in the Tech World)
The way you use to explain the concept on paper is best way to understand more clear... Plzz keep going the same way.. it is very helpful specially for those who are beginners in IT , I’ll also share with people in need.. Thank you
I have all your SQL videos in my watch list will watch them on repeat you could be the main reason if I will be cracking my interview which is scheduled next week.
Whoever you are , if you read my msg, then i want to say you.....Your voice is very beautiful and your explanation is crystal clear. Thank you very much and keep up the good work.
This problem can also be solved by using inline view followed by a rownum attribute, but rownum is only supported by Oracle. But thanks for explanation.
I really appreciate your efforts. I think we can do something like this without inner query -> select * from employees order by salary desc limit 1 offset 1(/limit 1,1);
TH-cam was not that time we were doing study else we will have strong concepts with the help of such teacher. But still after 14 years of working experience these query were not such cristal clear to us.... But you did such magic with paper and pencil.... Really appreciatable.... I like that way of reading and learning.... Keep doing it with other technical concept too.
calm and cool explanation . i wish my teachers would explain like you.. but seriously u have a great and smooth voice. Thank you for explaining. Make more videos on database.
All those works fine with 2nd highest salary but these needs access logic if N changes, You could have solve these queries using rank and dense ranks in a generic way. Great explanations. Keep going.
This was hard question for me before watching, but after watching your video..this question becomes so simple and quite easy.. thanks 😊😊😊 Give more videos and best of luck to you.
@@version3.028 for selecting 2nd highest salary using limit --> SELECT salary FROM employee ORDER BY salary DESC LIMIT 1,1 ========================================================== for selecting nth highest salary using limit --> SELECT salary FROM employee ORDER BY salary DESC LIMIT n,1
Can you help me in this? Assume you have a table with the following fields: Emp_name Sal_Date Salary Also, assume that Salary credit data is populated in the table and that the data is available from 2015 to 2020. Write SQL query to print the name of the employee who got a max% hike in the annual salary from 2018 to 2019.
Mam I have a Doubt.. In one of your Videos you have mentioned you CANT use "Where" when aggregate functions are used. Only HAVING should be used?But you have used where in the first example. Can you Clarify me ?
i have 3 tables 01) table employee (columns are empid,empname , depid) 02) table Department ( columns are depid, dep name) 03) table salary (columns are empid,amount,month). Q) get the empname , how don't get the salary in the month of December ? please let me the ans for this question
Nope.... When u use aggregate in filter then we have to use HAVING.... Here she is just using "Salary" and not "max(salary)" so we have to go with WHERE clause only
same question here. why is as emp used? i executed it without as emp and it throwed an error "Incorrect syntax near the keyword 'order'. " with as emp it is getting executed rightly.
Please tell me one thing. WHERE works on rows not aggregated data, has been told by you in later video of differences so why we are using WHERE in place of HAVING.
i have a problem as you said we can't use aagregarte functions with "where", then how did you use MAX(SALARY) and not used group by or having and why have you used ''WHERE', PLEASE ADDRESS THIS QUERY, SINCE it is very urgent.
in first difference between video you mentioned that we cannot use WHERE if we are using any aggregate function and we should use HAVING instead and you said it again and again, So should we use it or please clear this doubt I wonder why no ever asked this question.
A lot of people had this doubt so I made this one video to clear all doubts. th-cam.com/video/ggBXefD4UT8/w-d-xo.html Watch this and let me know in case of any doubts
How can I find second min salary from a emp table.? I tried this way Select * from emp Where sal=(select min(sal) from emp Where sal>(select min(sal) from emp)); Is there any other way? What if I want to find nth min salary and nth max salary from emp table
Your query seems correct to me.👍 For nth min salary you can do: SELECT TOP 1 salary FROM ( SELECT TOP n salary FROM employee ORDER BY salary ASC) ORDER BY salary DESC; Similarly you can do for nth max salary.
Hey in one video you said that we cannot use where clause with aggregate functions , we need to use having clause.....but here you are using where with max function??
Hi, a lot of people are confused because of this. So I made this video to clear the doubt. th-cam.com/video/ggBXefD4UT8/w-d-xo.html Watch this and all your doubts will be cleared.
I love all your explanations. But I hope u will improve your thumbnail. Handwritten notes is easy to see for explanations but bad for a thumbnail and makes me not want to click the video. Just a suggestion.
✨Link to my SQL e-book: imojo.in/rkajq9
✨Link to 'Switch your career easily' e-book: imojo.in/1FL7KaG
(Perfect for anyone willing to switch to a completely new field or to a different company in the Tech World)
Without using a IDE to execute the SQL code, you did a great job in explaining your query code. Thank you.
Thank you for your kind words :)
Htui3guurghhytghhht
This series was extremely helpful for my placements
LEAVE THE QUESTION ..OMG YOUR VOICE
The way you use to explain the concept on paper is best way to understand more clear... Plzz keep going the same way.. it is very helpful specially for those who are beginners in IT , I’ll also share with people in need.. Thank you
Hii bro
We can also use query select * from emp e1 where 1=(select count(salary) from emp e2 where e2.salary>e1.salary)
I have all your SQL videos in my watch list will watch them on repeat you could be the main reason if I will be cracking my interview which is scheduled next week.
I did not crack the first one but cracked the second one 😎
Good .congratulations.
Whoever you are , if you read my msg, then i want to say you.....Your voice is very beautiful and your explanation is crystal clear.
Thank you very much and keep up the good work.
Thank you so much. Means a lot!
She's a secret superstar!
This problem can also be solved by using inline view followed by a rownum attribute, but rownum is only supported by Oracle. But thanks for explanation.
Select max(salary)from employees
Where salary !=(select max (salary)from employees)
Run this query easy to understand
I really appreciate your efforts. I think we can do something like this without inner query -> select * from employees order by salary desc limit 1 offset 1(/limit 1,1);
That's not possible in Oracle SQL...
In mysql it works ...but only for distinct salary
TH-cam was not that time we were doing study else we will have strong concepts with the help of such teacher. But still after 14 years of working experience these query were not such cristal clear to us.... But you did such magic with paper and pencil.... Really appreciatable....
I like that way of reading and learning.... Keep doing it with other technical concept too.
Great explanation and providing the different ways of solving the same problem is what most of us want. Thanks a lot.
calm and cool explanation . i wish my teachers would explain like you.. but seriously u have a great and smooth voice. Thank you for explaining. Make more videos on database.
Haha thank you so much :)
Select * from employee order by salary desc limit 2;
I think it is possible to fetch second highest salary
Awesome explanation, thanks for making such an informative SQL interview question
Damn good... explained so well and your voice is just amazing...
For limit you can do , select salary from employee order by sal desc n-1,1 n varies accordingly
The way you teaches is so much good and easy ...other than your voice is treat for ears
simple query :
Select salary from employee order by salary desc limit 1 offset 1:
All those works fine with 2nd highest salary but these needs access logic if N changes, You could have solve these queries using rank and dense ranks in a generic way. Great explanations. Keep going.
This was hard question for me before watching, but after watching your video..this question becomes so simple and quite easy.. thanks 😊😊😊
Give more videos and best of luck to you.
Thanks a lot. Glad it helped you
Pen and paper wins. Hence proved by this awesome video by awesome voice. No need of fancy stuff.
very good explanation without using any device , any body can understand it in one time, Loved it
Hii ma'am...thank you so much for sharing this vedio.It's very useful to me..
Please put more vedios on sql like this way......
By the way your voice is sooo cute... 👏👏👏
Thank you so much! :)
For selecting max salary using LIMIT --> SELECT salary FROM employee ORDER BY salary DESC LIMIT 1 ( doesn't this give us the max salary?)
Bro same question....did u get any solution for it....
@@version3.028 for selecting 2nd highest salary using limit -->
SELECT salary FROM employee ORDER BY salary DESC LIMIT 1,1
==========================================================
for selecting nth highest salary using limit -->
SELECT salary FROM employee ORDER BY salary DESC LIMIT n,1
@@pannagasudarshan6639 bro thanks,but i get it one hours ago....
Limit does not work in oracle database,.....you can try with FETCH FIRST 2 ROWS ONLY....watch full syntax here.....
FINDING Nth Highest Salary ??
I think we can do it without an inner query
SELECT Salary
FROM Employee
ORDER BY Salary DESC LIMIT 1 OFFSET (N-1)
@Shivani Aggarwal 2191
which tables are you talking about here?
@Shivani Aggarwal 2191 table?
Crisp and crystal clear explanation. Thank you!!!
Select salary from employee order by salary desc limit 1 offset 1
Thanks alot... i went through so many blogs.... but your explanation is crstal clear....
select * from employees
where salary <
(select max(salary) from employees)
order by salary desc
limit 1;
Can you help me in this?
Assume you have a table with the following fields:
Emp_name Sal_Date Salary
Also, assume that Salary credit data is populated in the table and that the data is available from 2015 to 2020.
Write SQL query to print the name of the employee who got a max% hike in the annual salary from 2018 to 2019.
Mam I have a Doubt.. In one of your Videos you have mentioned you CANT use "Where" when aggregate functions are used. Only HAVING should be used?But you have used where in the first example. Can you Clarify me ?
i have 3 tables
01) table employee (columns are empid,empname , depid)
02) table Department ( columns are depid, dep name)
03) table salary (columns are empid,amount,month).
Q) get the empname , how don't get the salary in the month of December ?
please let me the ans for this question
SELECT DISTINCT Salary FROM Employee ORDER BY Salary DESC LIMIT 1 OFFSET 1
This will also work right..
GREATEST EXPLANATION
We can also use dense_rank()
Much better in case we want nth salary
Mam max(salary) is an aggregate function so we use having clause instead of where clause🤔
Nope.... When u use aggregate in filter then we have to use HAVING.... Here she is just using "Salary" and not "max(salary)" so we have to go with WHERE clause only
Yes....correct.....having max( salary) and only where salary....
Is it necessary to write AS EMP after the inner query or the code shall execute correctly without it also? Please clarify?
same question here. why is as emp used? i executed it without as emp and it throwed an error "Incorrect syntax near the keyword 'order'.
" with as emp it is getting executed rightly.
SELECT * FROM employees ORDER BY salary DESC LIMIT 1 OFFSET 1;
Mam is this one of the way we can solve this quire
We can write this with single query
Select salary from emp order by salary desc limit 1, 1;
I've tried your query in SQL SERVER MANAGEMENT STUDIO and it's not working for me.
SELECT SAL FROM EMP
ORDER BY SAL DESC LIMIT 1, 1;
Hi.
Can you please explain about performance tunning in sql.
Thanks in Advance.
Great Explanation...Impressed
I didn't get any videos on youtube for such an easy methods
madam aap bhaut acha explain karte ho thank you..............
best channel for sql
THANK YOU SO MUCH YOUR VIDEOS ARE VERY HELPFULL.......
Really awesome but I have an doubt?
Which one gives( max, limit,top) best performance and why?
am i in heaven!! coz your voice seems like the voice of an angel
Best teach thanks 🙏... please make blog on calculate the third highest salary or nth highest salary.
Thank you again 🙏
Please tell me one thing. WHERE works on rows not aggregated data, has been told by you in later video of differences so why we are using WHERE in place of HAVING.
Thanks for this video .... Your voice is to good yaar...
Excelnt mam pls do more on SQL and power bi also mam tq
You are such a great teacher!
Superb explanation great work 👍
i have a problem as you said we can't use aagregarte functions with "where", then how did you use MAX(SALARY) and not used group by or having and why have you used ''WHERE', PLEASE ADDRESS THIS QUERY, SINCE it is very urgent.
in first difference between video you mentioned that we cannot use WHERE if we are using any aggregate function and we should use HAVING instead and you said it again and again, So should we use it or please clear this doubt I wonder why no ever asked this question.
A lot of people had this doubt so I made this one video to clear all doubts. th-cam.com/video/ggBXefD4UT8/w-d-xo.html
Watch this and let me know in case of any doubts
SELECT * FROM STUDENT WHERE MARKS=(SELECT MARKS FROM STUDENT GROUP BY MARKS ORDER BY MARKS DESC LIMIT 1,1);
How can I find second min salary from a emp table.?
I tried this way
Select * from emp
Where sal=(select min(sal) from emp
Where sal>(select min(sal) from emp));
Is there any other way? What if I want to find nth min salary and nth max salary from emp table
Your query seems correct to me.👍
For nth min salary you can do:
SELECT TOP 1 salary FROM ( SELECT TOP n salary FROM employee ORDER BY salary ASC) ORDER BY salary DESC;
Similarly you can do for nth max salary.
Ma'am if u dont mind could u share this handwritten copy through drive link or anyother way. As its really helpful for interview preparation.
Get full solutions here for all sql plsql interview questions.....
can you make the video about performance tuning &
,sql agent concept..
Can u explain about normalisation&denormolization..bcoz..this is the frequently asked questions in interview
Thank you for explaining this. Make more videos.
Thank you :)
Great video. Thanks.
Very nice. Very nice explanation
Simple clear and to the point..
Thanks for sharing...
😊😊
really great explanation....
Fantastic explanation
hi, one quick doubt, will it work ( LIMIT) even when we have duplicate salary in our list.. or do we need to use distinct keyword in the subquery.
We can using ranking function to do the same
Short and sweet explanation.
Great explanation
madam konse server(DATABASE) ke liye konsi query CHALEGI ye to batao....?
Nicely explained, well done 🙏
This needed a DISTINCT, to overlook repetitive data.
In the last question, finding 2nd largest in the last approach do we need to order by twice with TOP?
Yes, in both the cases i.e. while using Limit as well as Top.
Hey in one video you said that we cannot use where clause with aggregate functions , we need to use having clause.....but here you are using where with max function??
Hi, a lot of people are confused because of this. So I made this video to clear the doubt.
th-cam.com/video/ggBXefD4UT8/w-d-xo.html
Watch this and all your doubts will be cleared.
Super explaination..
I am lazy person can anyone who made notes share them. I will pray for those.
Omg nice voice plus great explanation ...
Thanks a lot sharing thease. Your voice so sweet.
Do we need to use group by salary also? Because if salary 7000 is repeating 2 times so 7000 will be at top two times by using order by salary desc.
Can you explain for 3rd highest salary
You can use rank function in with clause.....and then whatever rank u want u can fetch.....watch full solution here.....
how you create this video , can you share the set up
Hi
Is there any difference between TOP and Limit ?
Can we use Limit and Top in Oracle SQL
Easiest explanation 💯 thank you..
You're welcome :)
Super explanation ans your voice super
while i am executing top command in sql command line it is giving error "
FROM keyword not found where expected"
You are an amazing tutor 😍❤️
Thank You so much, this video helped to me.
The way you explain i got it thanks ☺️👍👍👍
😊😊
Wonderful. Can I do it ms access
Please send me this type of question which can ask in interview? Its my Hamble request..
I love all your explanations. But I hope u will improve your thumbnail. Handwritten notes is easy to see for explanations but bad for a thumbnail and makes me not want to click the video. Just a suggestion.
Thank you for the suggestion!
Nice voice and good explanation
Mam how to write query to fetch the employees with its department_name can you please tell me as soon as possible
Heyy....your voice is too good
All the best !!👍
Thaaaank youuu :)
When I use limit function it shows missing right parenthesis please help madam