Group By and Having Clause in SQL | SQL Tutorial in Hindi 9

Поделиться
HTML-код
  • Опубликовано: 5 авг 2024
  • SQL Full Course Playlist 👇
    • SQL Tutorial In Hindi
    Like, Share & Subscribe Now :)
    ⭐ Subscribe for more SQL tutorials like this: bit.ly/3Fc7Gc6
    👉 customer csv file: bit.ly/3KLPb2P
    👉 payment csv file: bit.ly/41kIYjW
    📢 GitHub link (all files): bit.ly/3Y7SRPr 📢
    ➖➖➖➖➖➖➖➖➖➖➖➖➖
    Timestamps:
    00:00 Intro
    00:04 Group By Statement in SQL
    01:05 Group By Example
    05:42 Having Clause in SQL
    07:01 Having clause example
    09:57 Assignment 01
    Like, Share, Subscribe Now :)
    Target keywords: group by statement in sql, having clause in sql, group by and having in sql, group by queries, having query
    ➖➖➖➖➖➖➖➖➖➖➖➖➖
    Related Videos
    Introduction to SQL - What Is SQL + Database | SQL Tutorial In Hindi 1
    • What Is SQL ? | Databa...
    Data Types, Primary-Foreign Keys & Constraints in SQL | SQL Tutorial In Hindi 2
    • Data Types, Primary-Fo...
    Create Table In SQL & Create Database | SQL Tutorial In Hindi 3
    • Create Table In SQL & ...
    INSERT UPDATE, DELETE & ALTER Table in SQL With Example | SQL Tutorial in Hindi 4
    • INSERT UPDATE, DELETE ...
    SELECT Statement & WHERE Clause with Example | Operators in SQL | SQL Tutorial in Hindi 5
    • SELECT Statement & WHE...
    How To Import Excel File (CSV) to SQL | Import Data From File | SQL Tutorial in Hindi 6
    • How To Import Excel Fi...
    String Functions in SQL | Functions in SQL | SQL Tutorial in Hindi 7
    • String Functions in SQ...
    Useful videos
    How to Become Data Analyst in 2022 | Data Analyst Roadmap
    • How to Become Data Ana...
    Data Analyst skills, jobs and Roadmap
    • Data Analyst- Skills, ...
    Excel Tutorial for Beginners
    • Excel for Beginners | ...
    ➖➖➖➖➖➖➖➖➖➖➖➖➖
    Connect on other Social Media handles:
    Instagram: / rishabhnmishra
    LinkedIn: / rishabhnmishra
    Twitter: / rishabhnmishra
    ➖➖➖➖➖➖➖➖➖➖➖➖➖
    If this is the first ever video you're watching allow me to introduce myself, Hey I'm Rishabh Mishra and currently working as Senior Data Analyst at Bangalore. On this channel I like to guide and help my juniors and data science aspirants regarding Data Science jobs and useful tips for college students.
    Have a great day buddy!

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

  • @durgeshjaiswal1233
    @durgeshjaiswal1233 9 месяцев назад +10

    @rishab Mishra- i came here to give you thanks....mai jaha jaha pe fasta hu chhoti chhoti meri issues ar question hote hai vo bhi aap cover kar rhe (vo jo apne bola na unique value wale column ko ku nhigrp kiya jata hai ar ye kuchh logo ka doubt hota hai mai us category se belong karta hu....dil jit liya sir apne...hatsoff

  • @_empire_dk
    @_empire_dk 10 месяцев назад +41

    1--Select * from 'table name '
    Where limit =4
    Group by 'table name '
    Having count (amount)>=3
    Order by DESC

  • @aakashyadav825
    @aakashyadav825 Год назад +19

    Sir order is : Select, From, Where, Group By, Having, Order By, Limit.
    Thank you Sir for the awesome explanation of Group By clause.! 🙌

    • @laxmipriya9379
      @laxmipriya9379 11 месяцев назад +10

      This is order of writing. But order of execution is --from, join, where, group by, having, select, order by, limit

    • @priyanshugupta6815
      @priyanshugupta6815 4 месяца назад

      bhai job lag gyi???

  • @vaibhavv475
    @vaibhavv475 7 месяцев назад +9

    FROM: Specifies the table or tables from which to retrieve data.
    WHERE: Filters the rows based on specifie conditions.
    GROUP BY: Groups the result set by one or more columns.
    HAVING: Filters the grouped rows based on specified conditions.
    SELECT: Specifies the columns to be included in the result set.
    ORDER BY: Sorts the result set based on specified columns.
    LIMIT: Restricts the number of rows in the result set.

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

      Chat Gpt 😆

  • @mahimaas1944
    @mahimaas1944 11 месяцев назад +8

    sir you are doing a great job , Its more than what you think .

  • @kuldipmahale9762
    @kuldipmahale9762 8 дней назад

    You explained it really well. I was looking for a clear explanation for this topic.

  • @Phenomenalsanjeev16
    @Phenomenalsanjeev16 10 месяцев назад +14

    It's already in the right order of execution brother 💯

    • @pokebro352
      @pokebro352 5 месяцев назад

      On limit is in end but it will come after where

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

      @@pokebro352 NOT NECCESERY BRO

  • @ShubhamPatil..
    @ShubhamPatil.. Год назад +4

    Thank You SIR

  • @YashSingh-xs5yj
    @YashSingh-xs5yj 7 месяцев назад +3

    Thank you so much, this tutorial is so easy to understand!

  • @Vikash-the-analyst
    @Vikash-the-analyst 5 месяцев назад +3

    select mode, sum(amount) from payment
    where amount >= 300
    group by mode
    having sum(amount)
    order by sum(amount)
    limit 3;

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

    Such a nice 🙂

  • @studyofbca
    @studyofbca 8 месяцев назад +1

    i love you sir kiya samjhate hoo

  • @pkabc3454
    @pkabc3454 5 месяцев назад +4

    SELECT: use to read data from database
    FROM : column_name
    WHERE : where exists the condition /filter record
    GROUP BY : put the same value in the same row
    HAVING : filter result
    ORDER BY : filter result ASC/DESC
    LIMIT : it use to upper limit on the number of tuple

  • @user-ns8vf2dk1u
    @user-ns8vf2dk1u 12 дней назад +1

    Good job

  • @IrfanKhan-wv8rh
    @IrfanKhan-wv8rh Год назад +1

    Excellent sir. Nice teaching method

  • @niteshsrivastava9272
    @niteshsrivastava9272 5 месяцев назад +3

    select column_name(s)
    from table_name
    where = condition(s)
    group by column_name(s)
    having condition(s)
    order by
    limit

  • @theentertainmentworld3310
    @theentertainmentworld3310 10 месяцев назад +1

    Perfect video for this topic,❤

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

    amazing🥰

  • @GauravSharma-ui1ub
    @GauravSharma-ui1ub 6 месяцев назад +2

    select mode, sum(amount) as total, count(amount) as count
    from payment
    where mode = 'cash'
    group by mode
    having count(amount)>=0
    order by count
    limit 10

  • @GauravSingh-zt4us
    @GauravSingh-zt4us 9 месяцев назад

    love u bhai

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

    Thank you for helpful information

  • @mirzailyas7196
    @mirzailyas7196 9 месяцев назад +6

    1.SELECT(column_name)
    2.FROM(table_name)
    3.WHERE(Condition)
    4.GROUP BY(column_name)
    5.HAVING(condition)
    6.ORDER BY(ASC OR DESC)
    7.LIMIT(How many rows you need in number)

    • @AsimaIqbal101
      @AsimaIqbal101 6 месяцев назад

      from will execute first

    • @AsimaIqbal101
      @AsimaIqbal101 6 месяцев назад

      FROM
      JOINS
      WHERE
      GROUP BY
      HAVING
      SELECT
      DISTINCT
      ORDER BY
      LIMIT
      (This is not for the given question)

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

    Aap ne sahi sequence me likhe hai ji..
    Select - from - where - group by - having - order by - limit

    • @Banker4408
      @Banker4408 4 месяца назад

      Correct order of execution is FROM > WHERE > GROUP BY > HAVING > SELECT > DISTINCT > ORDER BY > LIMIT.

  • @rahulboda7046
    @rahulboda7046 8 месяцев назад +2

    From (Table to get Base data)
    Where (Filters the Base data)
    Group By (Aggregate the Base Data)
    Having (Filters the Aggregate Data)
    Select (Returns the Final Data)
    Order By: (Sorts the Final Data)
    Limit: (Limits the Data to a Row Count)

  • @bhagwatdhavale6091
    @bhagwatdhavale6091 6 месяцев назад +1

    Gr8 bro
    Super explaination

  • @amaansayeed6614
    @amaansayeed6614 7 месяцев назад +2

    1. FROM + JOIN
    2. WHERE
    3. GROUP BY
    4. HAVING
    5. SELECT
    6. ORDER BY
    7. LIMIT + OFFSET

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

    Thank you bro!

  • @shrutisant
    @shrutisant 3 месяца назад +1

    Amazing playlist for SQL 😊

  • @rath9096
    @rath9096 11 месяцев назад

    How to increase the runtime speed ? Because my same query took 26 sec to complete even though my laptop ram is 8GB and also has a good processor.

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

    thankyou sir it is so helpfull

  • @user-rd1xg7co8p
    @user-rd1xg7co8p 6 месяцев назад +1

    hello Rishabh good video i had some problems in understanding it, but now it's totally clear. coming to the question the order is as follows from-where-select-groupby-having-orderby-limit

  • @babypal7484
    @babypal7484 11 месяцев назад +2

    1.SELECT(column_name) FROM(table_name)WHERE(condition)GROUP BY(column_name)HAVING(condition)ORDER BY(ASC or DESC)LIMIT 3 ;

  • @supriyakushwaha-bw1bn
    @supriyakushwaha-bw1bn Месяц назад

    You explained it really well. I was looking for a clear explanation for this topic. I see other RUclipsrs just reading the text copied from SQL documentation without even caring to explain.

  • @MrYash-cs9nk
    @MrYash-cs9nk 4 месяца назад +4

    ! select*from table name
    where limit+4
    group by (table name) As Total
    having count ( amount) >=4

    • @RishavKapil-ct4io
      @RishavKapil-ct4io Месяц назад

      galat h bhaii WHERE ke sath condition ayega LIMIT condition thori h koi

  • @UmerKhan-ro3dy
    @UmerKhan-ro3dy 9 месяцев назад +1

    Best

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

    best hai sir

  • @bhoomikanamdev6702
    @bhoomikanamdev6702 Месяц назад +1

    your videos are awesome, i need your guidance sir, please tell me how can you mentor?

  • @prajjwalsingh3991
    @prajjwalsingh3991 Год назад +45

    SELECT(columns/everything) FROM(Table name)
    WHERE(Apply condition)
    GROUP BY(Columns name you want to group) AS (Column header name)
    HAVING(apply condition) [For more condition use OPERATORS]
    ORDER BY (Column header name with ASC/DESC)
    LIMIT(Count of rows you want)

  • @aasmohammad6332
    @aasmohammad6332 Год назад +2

    Select "any column or full table" from 'table_name'
    Where 'apply any condition'
    Group By 'any column use table if have repeated value'
    Having 'applying any condition'
    order by 'use for sort the data'
    Limit 'how many rows we need'

  • @DeadlyGaming407
    @DeadlyGaming407 4 месяца назад +1

    7:20 sir apne to funny krdiya idhar🤣 mast padhate ho aap
    btw order is
    select from
    where
    group by
    having
    order by
    limit

  • @toxicharry8784
    @toxicharry8784 5 месяцев назад +3

    really nice explanation .. this dude teaches damn clearly

  • @sonirana4281
    @sonirana4281 Год назад +3

    Select->From -> where -> group by -> having -> order by -> limit

    • @Banker4408
      @Banker4408 4 месяца назад +2

      Correct order of execution is FROM > WHERE > GROUP BY > HAVING > SELECT > DISTINCT > ORDER BY > LIMIT.😊 this is the correct order😊

  • @user-pi8ke7rk3c
    @user-pi8ke7rk3c 10 месяцев назад +1

    select*from table_name where condition group by columns having condition order by columns desc/asc limit range

  • @ArtCorner...
    @ArtCorner... Год назад +6

    FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER BY, LIMIT

  • @anuraggoud07
    @anuraggoud07 12 часов назад

    Tommorow is my SQL interview. If I select this guy will be responsible.

  • @umairahmed9967
    @umairahmed9967 10 месяцев назад +2

    select
    from
    where
    group by
    having
    order by
    limit

  • @hk0153
    @hk0153 Год назад +2

    Order of execution in SQL:
    Select, from, where, group by, having, order by and limit

  • @TravelWithAjaj
    @TravelWithAjaj 9 месяцев назад +1

    From>where>Group by> having >select >order by >limit

  • @Sbk_Tech
    @Sbk_Tech 8 месяцев назад +1

    1). SELECT: it specify the column you need,
    2). FROM: this statement use to pinpoint the table, wheres your desired data,
    3). WHERE: it allowing only those data that meets specific conditions to pass throgh,
    4). GROUP BY: Organizing the data based on specified columns,
    5). HAVING: If your data is grouped HAVING allow for futher improvements,
    6). ORDER BY: It Sequencing or arrange the results in Ascendng or descending order,
    7). LIMIT: It specify the number of rows there you want to display.

  • @ghilbadshaw9377
    @ghilbadshaw9377 9 месяцев назад +1

    1 select
    2from
    3 where
    4 group by
    5 having
    6 order by
    7 limits

  • @fitking1234
    @fitking1234 6 месяцев назад +1

    good video

  • @sarvammittal4242
    @sarvammittal4242 26 дней назад

    Hi Rishabh,
    Could you please also explain how to remove duplicates using Group by and having clause.

  • @sayan_malik7
    @sayan_malik7 7 месяцев назад +1

    select
    from
    group by
    having count
    order by total

  • @suyashawasthi4240
    @suyashawasthi4240 Год назад +11

    Same order as given in Problem : Select,From,Where,Group By,Having,Order By,Limit

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

    Order is:
    from (choose database)
    where (filter database)
    group by (aggregate database)
    having (filter aggregated database)
    select (return final result)
    order by (sort final result)
    limit(limit's the result)

  • @pankajydadv9918
    @pankajydadv9918 27 дней назад

    FROM- WHERE- Group by- HAVING- Select- Order by- LIMIT
    It is the correct format for query execution

  • @Banker4408
    @Banker4408 4 месяца назад +1

    HAVING clause can be used before or after GROUP BY clause (but we should prefer after group by clause) 😊

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

    1.select from
    2.where
    3.group by
    4.having
    5.order by

  • @TheAccurateCoder
    @TheAccurateCoder Год назад +33

    1.SELECT(column_name)
    2.FROM(table_name)
    3.WHERE(condition)
    4.GROUP BY(column_name)
    5.HAVING(condition)
    6.ORDER BY(ASC or DESC)
    7.LIMIT(number :- how much row you want) ;

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

      first it's FROM which shows from which table you wanna get the data from

  • @Mohsin_Naqvi7
    @Mohsin_Naqvi7 27 дней назад

    select mode, count(amount) as total
    from empinfoo
    group by mode
    having COUNT(amount) > = 4
    order by total asc

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

    Select- column
    From - table name
    Where - condition apply
    Group by - column name
    Having - condition
    Order by - asc / desc
    Limit -

  • @mohammadsadique1131
    @mohammadsadique1131 10 месяцев назад +1

    1.SELECT
    2.FROM
    3.WHERE
    4.GROUP BY
    5.HAVING
    6.ORDER BY
    7.LIMIT

  • @ekafrancium
    @ekafrancium 2 месяца назад +1

    SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT is this correct?

  • @AiWithDanish
    @AiWithDanish 11 месяцев назад +1

    SELECT mode, COUNT(amount) AS total
    FROM purchase
    GROUP BY mode
    HAVING COUNT(amount) >= 2 AND COUNT(amount) < 4
    ORDER BY total DESC

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

    select mode,count(amount) from payments
    Where mode = 'Cash'
    group by mode
    having count(amount)

  • @AATISH842001
    @AATISH842001 9 месяцев назад +2

    From where Group by having select limit

  • @rushikeshphanse228
    @rushikeshphanse228 9 месяцев назад +1

    Order of execution is as follows:
    From
    Where
    Group By
    Having
    select
    Order By
    limit

  • @Nirvan_96
    @Nirvan_96 7 месяцев назад +2

    order of execution: same as shown on screen.

  • @divyanshisharma4054
    @divyanshisharma4054 8 месяцев назад +1

    from --> where --> group by --> having --> order by --> limit --> select

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

    please continue this playlist

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

      That is all required for a data analyst role. What other topics do you want to learn?

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

      @@RishabhMishraOfficial please solve hackerrank or leet code problems medium and hard level

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

    Rishabh i have a doubt, order of execution is what MYSQL works with but what is the sequence for writing a query because in writing we use SELECT in the first place..?

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

      In SQL, the order of writing a query does not necessarily reflect the order of execution. The order of writing a query is more about the logical flow of constructing the query and specifying the desired results.

  • @praveenbhukya8035
    @praveenbhukya8035 5 месяцев назад +1

    from
    where
    group by
    having
    select
    order by
    limit

  • @patel_darshan_2803
    @patel_darshan_2803 Месяц назад +1

    it execute as it is, what you have write.. 🙂🙂

  • @arunkumar740
    @arunkumar740 4 месяца назад

    Good Hi Please share video in nested if to complete video

  • @orahichal
    @orahichal Год назад +2

    SELECT * FROM
    WHERE condition(s)
    GROUP BY column_name()
    HAVING condition(s)
    ORDER BY column_name
    LIMIT

  • @khateebahmad862
    @khateebahmad862 3 месяца назад +1

    correct order is- from, where, group by, having, select, order by, limit

  • @sandipanmajumder9419
    @sandipanmajumder9419 Год назад +2

    SELECT column_name(1) AS alias FROM table_name
    WHERE condition(s)
    GROUP BY column_name(1)
    HAVING condition
    ORDER BY column_name(1) / alias asc/desc
    LIMIT ;

  • @user-isnerd
    @user-isnerd Год назад

    Select (column name) From (table name)
    Where ( condition)
    Group by (column name)
    Having (column name)
    Order by (column name) ASC/DSC
    Limit(Count of rows)

  • @urfashionguider306
    @urfashionguider306 7 дней назад

    select column_name from table where limit=___ group by ___ having___ order by___

  • @atulsharma5700
    @atulsharma5700 10 месяцев назад +3

    Order of execution in SQL:
    Select
    FROM
    WHERE
    GROUP BY
    HAVING
    ORDER BY
    LIMIT

    • @AsimaIqbal101
      @AsimaIqbal101 6 месяцев назад

      FROM will Execute first then where , Group by , Having , then select upto so on

  • @MM-zd1mr
    @MM-zd1mr 3 месяца назад +1

    select, from, where,limit,groupBy,having, order By
    am i right?????

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

    Select cl_name from t_n
    Where condition
    Group by cl_name
    Having condition
    Order by cl_name
    Limit;

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

    SELECT,FROM,WHERE,LIMIT,GROUPBY,HAVING,ORDERBY is the order of execution. Thanks

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

      It's incorrect. For a detailed explanation, watch my playlist on sql interview questions and answers

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

    I think ORDER BY and LIMIT can be in same order or can be changed
    please reply and correct me

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

    Execution order - from -> where -> order by -> having -> select -> order by -> limit

  • @mahendrajharbade3078
    @mahendrajharbade3078 3 месяца назад +1

    Select
    From
    Where
    Group by
    Having
    Order by
    Limit

  • @kaustubh470
    @kaustubh470 3 месяца назад +1

    order of execution: From, where, group by, having, select, order by, limit

  • @parvchopra1456
    @parvchopra1456 11 месяцев назад +1

    hiii sir why is it so FROM>WHERE>GROUP BY>HAVING>SELECT>ORDER BY>LIMIT ?
    AS when we type a query its look like SELECT>FROM>WHERE>GROUP BY>HAVING>ORDER BY>LIMIT
    IS there any particular reason ? or is it just like that ?

    • @RishabhMishraOfficial
      @RishabhMishraOfficial  11 месяцев назад

      Yess for detailed answer you can watch my video on- Most Asked Sql interview questions and answers

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

    select mode, count(amount) as total from payment
    group by mode
    having count(amount) >= 3 and count(amount)

  • @komaltambe9216
    @komaltambe9216 9 месяцев назад +1

    Order is correct which u given

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

    select , from, where, group by, having, order by, limit is the right answer i believe

  • @AnjuSharma-nh1mg
    @AnjuSharma-nh1mg 6 месяцев назад +1

    Select
    From
    Where
    Order by
    Limit
    Group by
    Having

  • @Hassan-wq9up
    @Hassan-wq9up 8 месяцев назад +1

    SELECT(column name)
    FROM(table-name)
    WHERE(condition)
    GROUP BY(column-name)
    HAVING(condition)
    ORDER BY(ascending or descending)
    LIMIT( no or anything else u need accordingly)..........

  • @ManavKumar-h6z
    @ManavKumar-h6z Месяц назад +1

    FROM + JOINS , WHERE,, GROUP ,HAVING,SELECT , DISTINCT , ORDER BY , LIMIT &OFFSET
    ORDER OF EXECUTION

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

    Plz give a video on MySQL keys

  • @sandeepkalwar604
    @sandeepkalwar604 Год назад +2

    Order of execution:
    SELECT, FROM, GROUP BY, HAVING, ORDERBY, LIST

  • @utkarshdixit3776
    @utkarshdixit3776 Месяц назад +1

    select, from, where, limit, group by , having , order by

  • @akashsomwanshi7071
    @akashsomwanshi7071 4 месяца назад +1

    SELECT
    FROM
    LIMIT
    WHERE
    GROUP BY
    HAVING
    ORDER BY

  • @ArunKumar-gx8iv
    @ArunKumar-gx8iv 3 месяца назад +1

    select ->from->where->group>having->order by ->limit

    • @ArunKumar-gx8iv
      @ArunKumar-gx8iv 3 месяца назад

      SELECT column1, column2, ...
      FROM table_name
      WHERE condition
      GROUP BY column_name
      HAVING condition
      ORDER BY column_name ASC|DESC
      LIMIT offset, row_count;

  • @sunnykashyap6932
    @sunnykashyap6932 11 месяцев назад

    Sir this is also in a sequence.