Комментарии:
Well Explained :)
ОтветитьHi Ankit,
This playlist is useful to level up on SQL skills. I have started with this "SQL Tips and Tricks" playlist and will move on to the other useful playlists.
A very clear and concise manner of explaining the important difference between the WHERE and the HAVING clause.
Thanks for all your efforts!!! 👍
Regards,
Deepak.
great
ОтветитьBoth are used to filter the records.
This is the similarity in these.
WHERE is used before aggregation and having is used after aggregation.
HAVING CLAUSE is used only when there is an aggregation and group by.
Where clause can be used without aggregation.
Hi Ankit - Clear and to the point as usual. Thank you so much for sharing your knowledge!
ОтветитьThe Having Clause will be used with the filtered value, But the question was , find the average salaries of departments > 10000, Then for AVG we have to consider all the values in each department, Am i right?
ОтветитьLast query is not clear..where should not be used with aggregated function i.e (avg) but u used it sir ?why
ОтветитьClear and concise. Thank you for the video
ОтветитьThanks for the information sir 😊
Ответитьcreate table employees
(emp_id int,
emp_name varchar(100),
department_id int,
salary int,
manager_id int);
insert into employees
values
(1,'Ankit',100,10000,4),
(2,'Mohit',100,15000,5),
(3,'Vikas',100,10000,4),
(4,'Rohit',100,5000,2),
(5,'Mudit',200,12000,6),
(6,'Agam',200,12000,2),
(7,'Sanjay',200,9000,2),
(8,'Ashish',200,5000,2)
Please find the DDL for this tutorial. Thanks.
hello, where can I download this dataset? to practice the sql?
ОтветитьThe tutorial is easy to understand. Only if you could raise the volume of your voice. It's hard to hear clearly
ОтветитьFor self practise, which software should we install in our laptop or any online complier should we use
ОтветитьHI Ankit can u plz share the datasets
ОтветитьHello sir i have doubt can you please suggest in which order should i follow your playlist i am complete beginner in sql
Ответить## Difference between WHERE and Having - interview point of view notes
==> WHERE clause cannot be used with aggregates where as HAVING can. This means WHERE clause is used for filtering individual rows where as HAVING clause is used to filter groups.
==> WHERE comes before GROUP BY. This means WHERE clause filters rows before aggregate calculations are performed. HAVING comes after GROUP BY. This means HAVING clause filters rows after aggregate calculations are performed. So from a performance standpoint, HAVING is slower than WHERE and should be avoided when possible.
==> WHERE and HAVING can be used together in a SELECT query. In this case WHERE clause is applied first to filter individual rows. The rows are then grouped and aggregate calculations are performed, and then the HAVING clause filters the groups.
==> So from a performance standpoint, HAVING is slower than WHERE and should be avoided when possible.
==> Another difference is WHERE comes before GROUP BY and HAVING comes after GROUP BY.
Thanks ankit
ОтветитьGood one. It’s clear 😊
ОтветитьNo doubt its adding value to all SQL beginners .
ОтветитьHow avg salary in first query was 10000 and in second it came 15000 for dept_id 100?
Ответитьcan you plz make intermediate or advance video course plz
your explanition is great
Thank you Ankit for breaking down the difference very clearly and easily. Looking forward to learn more. :)
ОтветитьThanks for the video. very informative. Could you please provide datasets used in the videos.
ОтветитьBasic but important concept nicely explained.
ОтветитьIt's informative
ОтветитьGreat explanation!
ОтветитьAwesome explanation Ankit
Ответить🙌🙌
ОтветитьAwesome 👌
ОтветитьSir date-time function related concepts please also Paytm interview questions related to sql. Cross join and especially subquries. I'm getting stuck in subqueries.
ОтветитьConcept clear in simplest way .
ОтветитьAnkit your videos are very helpful and very easy to understand.
but please also provide the table data so that we can practice and can also save the query for revision in future.
please
Thank you.
You are clearing concepts in most easiest way.
Really helpful. Thanks much buddy 👍👍
ОтветитьOrder of commands also matters we can never use having before where.
Because in the backend order of execution goes as below:
Query Process Steps
1. Getting Data (From, Join)
2. Row Filter (Where)
3. Grouping (Group by)
4. Group Filter (Having)
5. Return Expressions (Select)
6. Order & Paging (Order by & Limit / Offset)
Thanks Ankit!
Key Takeaways
Where - to filter records - checks record/rowwise
Having - to filter on top of aggregation
If both are used where will get executed before having.
All your videous are very useful! Keep going! Thank you!
Ответить👍
Ответить