sir in last query if we also want to print years_of_exp then what will we do . select location,years_of_exp,count(*) as total from student where years_of_exp>10 group by location having total>1; # its giving error
@@rahultewari8354 the corrected query will be: select location, years_of_exp, count(*) as total from students where years_of_exp > 10 group by location, years_of_exp having total > 1; It will not give any error but can give null if no such records are present or exist.
Undoubtedly one of the best courses.... But due to limitation of dataset its lacking a bit,,,, You should have used the provided schemas in Mysql... just a suggestion\
at 10:50 can be write as > select source_of_joining,count(*) from students where source_of_joining = 'Online'; why we use group by in the end, if we have filtered already?
hello sir i have a followup question regarding the last query .. select source_of_joining,count(*) as total from employee where exp>3 group by source_of_joining having total>2; this query chaecks the source_of_joining having total >2 after filtering exp>3 what if we want to check the source_of_joining having total >2 and after that check exp>3.. I am trying to do it like this but it is showing errror select source_of_joining,count(*) as total from employee group by source_of_joining having total>2 where exp>3;
Q1a. Display the total no. of students joined from each source & the lead sources through which more than 1 person has registered ----> SELECT source_of_joining,count(*) AS TOTAL from students GROUP BY source_of_joining HAVING TOTAL > 1;
b. Display the count of people who registered through linkedIN. ----> SELECT source_of_joining,count(*) AS TOTAL from students GROUP BY source_of_joining = 'linkedIN'; Q2. The locations from which more than 1 student has joined & students having more than 10 years of experience.
----> SELECT location, count(*) AS TOTAL from students where years_of_experience > 10 GROUP BY location HAVING TOTAL > 1;
Checkout the Big Data course details here: trendytech.in/?referrer=youtube_sql13
sir in last query if we also want to print years_of_exp then what will we do .
select location,years_of_exp,count(*) as total from student where years_of_exp>10 group by location having total>1;
# its giving error
@@rahultewari8354 the corrected query will be: select location, years_of_exp, count(*) as total from students where years_of_exp > 10 group by location, years_of_exp having total > 1;
It will not give any error but can give null if no such records are present or exist.
I couldn't find this much clarity in any of the explanations available on the internet. 🙂
Thank you Sir.. This was a wonderful session.. You have rightfully curated the program and touch-based the missing points.. Thank you again!!!!!!!!
Clear and Great Explanation on Where and Having Clause 👌👌👌👌
Sir you are the best teacher I ever learned from....
Have u get job ??
Nice content
Great sir (SQL session 12 _Difference between where and having in mysql)
nicely and clearly explained sir Loved this series
Undoubtedly one of the best courses.... But due to limitation of dataset its lacking a bit,,,, You should have used the provided schemas in Mysql... just a suggestion\
at 10:50 can be write as > select source_of_joining,count(*) from students where source_of_joining = 'Online';
why we use group by in the end, if we have filtered already?
What a great explanation, that made it crystal clear.
Wonderful explanation of both Where and Having clause, liking the entire series Sumit Sir.
I am happy to hear that you are liking the explanation :)
thanks a lot sir. very useful
Happy to hear that you found the content useful :)
was waiting ✋
Awesome explanation sir
Very much useful. Thanks a lot
thank you sir
We can't use alias name in having clause such as total. Why it is not throwing error in SQL server it will give error
great videos
hello sir i have a followup question regarding the last query ..
select source_of_joining,count(*) as total from employee where exp>3 group by source_of_joining having total>2;
this query chaecks the source_of_joining having total >2 after filtering exp>3 what if we want to check the source_of_joining having total >2 and after that check exp>3..
I am trying to do it like this but it is showing errror
select source_of_joining,count(*) as total from employee group by source_of_joining having total>2 where exp>3;
No, this is won't work like the way yu want to execute. Where always execute before the group by statement.
@@nitinrao1133 correct 💯
Good explanation
Sir can you please share the notes which you were saved in your notepad while Explaining
happy ending cool sir cool my god live long?
Have u get job help with this sql course
Can we get the document that u used
Is anyone can please tell me , why there is applied ...
Having total >1; I got confused
sir plese roll about cloud computing in big data
Q1a. Display the total no. of students joined from each source & the lead sources
through which more than 1 person has registered
----> SELECT source_of_joining,count(*) AS TOTAL from students
GROUP BY source_of_joining
HAVING TOTAL > 1;
b. Display the count of people who registered through linkedIN.
----> SELECT source_of_joining,count(*) AS TOTAL from students
GROUP BY source_of_joining = 'linkedIN';
Q2. The locations from which more than 1 student has joined & students having
more than 10 years of experience.
----> SELECT location, count(*) AS TOTAL from students
where years_of_experience > 10
GROUP BY location
HAVING TOTAL > 1;
Q1. b is incorrect ig
self join is not covered
Hindi mein kuch vichar kare sir
Awesome explanation.