Important SQL INTERVIEW question | Difference between where and having in mysql

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024

Комментарии • 38

  • @sumitmittal07
    @sumitmittal07  2 года назад

    Checkout the Big Data course details here: trendytech.in/?referrer=youtube_sql13

    • @rahultewari8354
      @rahultewari8354 Год назад

      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

    • @arnabpati2724
      @arnabpati2724 Год назад

      @@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.

  • @bacchemankesacche
    @bacchemankesacche Месяц назад

    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?

  • @therisingsinger4330
    @therisingsinger4330 7 месяцев назад

    Is anyone can please tell me , why there is applied ...
    Having total >1; I got confused

  • @rashmibhardwaj1254
    @rashmibhardwaj1254 2 года назад +2

    I couldn't find this much clarity in any of the explanations available on the internet. 🙂

  • @chanduyj
    @chanduyj 2 месяца назад

    Sir can you please share the notes which you were saved in your notepad while Explaining

  • @greatmonk
    @greatmonk Год назад +1

    Thank you Sir.. This was a wonderful session.. You have rightfully curated the program and touch-based the missing points.. Thank you again!!!!!!!!

  • @dkkashyap6494
    @dkkashyap6494 2 года назад +1

    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\

  • @bharathKumar-or6gd
    @bharathKumar-or6gd 3 месяца назад

    Clear and Great Explanation on Where and Having Clause 👌👌👌👌

  • @satyajeet4450
    @satyajeet4450 2 года назад +1

    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;

    • @tashi9154
      @tashi9154 2 года назад

      Q1. b is incorrect ig

  • @santoshatyam1409
    @santoshatyam1409 Год назад

    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

  • @smyphysics
    @smyphysics 2 года назад

    Great sir (SQL session 12 _Difference between where and having in mysql)

  • @amanhayaran1152
    @amanhayaran1152 Год назад

    nicely and clearly explained sir Loved this series

  • @Kush6542
    @Kush6542 2 года назад +1

    thanks a lot sir. very useful

    • @sumitmittal07
      @sumitmittal07  2 года назад

      Happy to hear that you found the content useful :)

  • @harshrajvaghela699
    @harshrajvaghela699 2 года назад

    sir plese roll about cloud computing in big data

  • @aakashsrivastava9808
    @aakashsrivastava9808 2 года назад

    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;

    • @nitinrao1133
      @nitinrao1133 2 года назад

      No, this is won't work like the way yu want to execute. Where always execute before the group by statement.

    • @therisingsinger4330
      @therisingsinger4330 7 месяцев назад

      ​@@nitinrao1133 correct 💯

  • @ravimishra339
    @ravimishra339 10 месяцев назад

    Awesome explanation.

  • @ashishthakur8619
    @ashishthakur8619 2 года назад

    Can we get the document that u used

  • @sharmisaha9655
    @sharmisaha9655 2 года назад

    self join is not covered

  • @abhishekkatara7584
    @abhishekkatara7584 2 года назад +3

    Wonderful explanation of both Where and Having clause, liking the entire series Sumit Sir.

    • @sumitmittal07
      @sumitmittal07  2 года назад

      I am happy to hear that you are liking the explanation :)

  • @poojachavan4091
    @poojachavan4091 Год назад

    thank you sir

  • @vishnujatav6329
    @vishnujatav6329 2 года назад

    Very much useful. Thanks a lot

  • @TrustinData
    @TrustinData 2 года назад

    Awesome explanation sir

  • @amitpandey7493
    @amitpandey7493 2 года назад

    Hindi mein kuch vichar kare sir

  • @farzicoderz
    @farzicoderz 2 года назад

    What a great explanation, that made it crystal clear.

  • @sayalipatkar2755
    @sayalipatkar2755 2 года назад

    great videos

  • @sagnikchakraborty734
    @sagnikchakraborty734 Год назад

    Sir you are the best teacher I ever learned from....

    • @khaan119
      @khaan119 Год назад

      Have u get job ??

  • @NAVEENKUMAR-nd7jg
    @NAVEENKUMAR-nd7jg Год назад

    happy ending cool sir cool my god live long?

    • @khaan119
      @khaan119 Год назад

      Have u get job help with this sql course

  • @saurabhpandey7603
    @saurabhpandey7603 2 года назад

    Good explanation

  • @ripulchhabra5686
    @ripulchhabra5686 2 года назад

    was waiting ✋