SELECT first_name, last_name, hourly_pay, (SELECT AVG(hourly_pay) FROM employees) AS avg_pay FROM employees; SELECT first_name, last_name FROM employees WHERE hourly_pay > (SELECT AVG(hourly_pay) FROM employees); SELECT first_name, last_name FROM customers WHERE customer_id IN (SELECT DISTINCT customer_id FROM transactions WHERE customer_id IS NOT NULL); SELECT first_name, last_name FROM customers WHERE customer_id NOT IN (SELECT DISTINCT customer_id FROM transactions WHERE customer_id IS NOT NULL);
Make a playlist that will help to learn everything about SQL bro. It will definitely useful for me and also lots and lots of your subscribers so please continue don't quit this and make everyone as a master in mysql those who are all learning these videos. Thanks for your efforts 🙂
Yo, I've been watching and learning from this course, soo much. I've tired learning SQL from books, but you explain it very easy. You are a hero, thank you BroCode!
The customer and transactions example would be normally done with JOIN: SELECT DISTINCT first_name, last_name FROM customers JOIN transactions ON customers.customer_id = transactions.customer_id; it's a bit shorter query, but it's cool to see that you can do this with other methods as well.
I have really enjoyed following your tutorials. I would like to complete some of the exercises on my own system. Are there files available to create the DB and data that you use in your videos? They would be greatly appreciated.
I think you should touch on the performance too! These subqueries can be costly and suck up CPU in large tables. In the first example, the average was computed per row while $14.35 was needed only once. Other than that, great video. Thanks!
I'm not sure if someone could answer this but I'll try: SELECT first_name, last_name, hourly_pay FROM employees WHERE hourly_pay > (SELECT AVG(hourly_pay) FROM employees); In this query, why can't we just, after the "greater than", write "AVG(hourly_pay)" ??
the concat function does it have to change the table also becaues the query is running fine but there are no changes at the schema although i refresh it ]
This looks like a nested "if" and "loop" statements in Java. I wouldn't be learning those without your tutorials in Java. And I know I will be learning those further when I start learning the other prog. languages you have on your playlist. Thank you so much!
ok i was pretty frustrated until i started this video hearing Bro Code calling the manager as "Krabs" or craps? is this intentional? Bor Code is my type!
I'm from the google data analytics programme and the instructor taking this part of the course is the worst ever. I didn't struggle understanding others but oh well, i have to use other resources to understand what she's saying. Very ambiguous Thanks anyway Bro
SELECT first_name, last_name, hourly_pay,
(SELECT AVG(hourly_pay) FROM employees) AS avg_pay
FROM employees;
SELECT first_name, last_name
FROM employees
WHERE hourly_pay > (SELECT AVG(hourly_pay) FROM employees);
SELECT first_name, last_name
FROM customers
WHERE customer_id IN (SELECT DISTINCT customer_id
FROM transactions WHERE customer_id IS NOT NULL);
SELECT first_name, last_name
FROM customers
WHERE customer_id NOT IN (SELECT DISTINCT customer_id
FROM transactions WHERE customer_id IS NOT NULL);
Good job bro waiting for this playlist from you I am a big fan of your work
Don't quit this playlist bro because I need to learn MySQL from a good instructor like you
Make a playlist that will help to learn everything about SQL bro. It will definitely useful for me and also lots and lots of your subscribers so please continue don't quit this and make everyone as a master in mysql those who are all learning these videos. Thanks for your efforts 🙂
After so many wrong and complicated examples on this topic finally a good and clear explanation, it helped me thanks.
In just a few minutes you made me understand what they explained to me at school for almost a month
i see this playlist before each step of my current hiring process 😁😁. Thanks a lot
Yo, I've been watching and learning from this course, soo much. I've tired learning SQL from books, but you explain it very easy.
You are a hero, thank you BroCode!
Yeah, been in the same spot in ISTQB course too. Not quite pleasant
Finally I've been looking for a good explanation all week and you delivered 🙌
Best explaination online
i am also learning to use subquerry's. Tbh it's pretty damn hard, but i feel like it's one of those things you learn with much much practice
I just started learning sql 2 weeks ago and i'm really struggling with subqueries. Does it get easier with practise?
your videos are so concise!!!! Niceeeee
A very clear and concise explanation.❤❤❤
Couldn't have explained it in a better way... appreciate it man!!!
great video explanation was very clear
Great explanation
Thank you ☺️
This is simplified...have been racking the brain for some days now..a milliin thanks
Bro Code, from the bottom of my heart: THANK YOU.
I'm learning sooo much from your videos, you're a life saver.
great explanation thank you.
The customer and transactions example would be normally done with JOIN:
SELECT DISTINCT first_name, last_name FROM customers
JOIN transactions ON customers.customer_id = transactions.customer_id;
it's a bit shorter query, but it's cool to see that you can do this with other methods as well.
that's exactly what i thought so would you use an inner join for this?
Very well explained
My professor made this more complicated than it seems. Thank you!
Thanks, well explained
"just imagine we replace the sub-query by what it returns" made me understand it
Excellent tutorial!
Hi bro, thanks for the vid. Much better than most creators do. Much appreciated
Verey nice project
Thanks a lot really helped .
best video about this argument, ty so much
You are the bestttttttttttt❤❤❤
Very helpful. Than you.
thanks man u explained it really chill, not like the other ones with all weird ass terms that i dont even know
I finally got to understand this topic. This was amazing.
Kudos and Bravos😂
thank you for this it's really useful bro💓💓💓💓
Thank you so much❤You explained so good❤Keep your work up❤You are insane
Great video sir 👌
I have really enjoyed following your tutorials. I would like to complete some of the exercises on my own system. Are there files available to create the DB and data that you use in your videos? They would be greatly appreciated.
you can find free ones online just search it up
LEGEND!
can also use INNER JOIN for this right? IN is more appropriate for smaller tasks though. Am I right?
Finished watching
Do you have a template to upload into MYSQL to use your example databases to follow along and type with you?
Thank you from Colombia
I think you should touch on the performance too! These subqueries can be costly and suck up CPU in large tables. In the first example, the average was computed per row while $14.35 was needed only once. Other than that, great video. Thanks!
I'm not sure if someone could answer this but I'll try:
SELECT first_name, last_name, hourly_pay
FROM employees
WHERE hourly_pay > (SELECT AVG(hourly_pay) FROM employees);
In this query, why can't we just, after the "greater than", write "AVG(hourly_pay)" ??
That's what I don't get either, what's the benefit to sub-queries over shorter commands like this?
Because you have to specify the table name. There could be other tables as well and MySQL needs to know exactly which one you want the result from.
Can't we write then avg(employees.hourly_pay)
I'm here because I'll have an interview in a few days. Good luck to me lol
This helped me so much. Thank you!!”
Thank you so much
Thank you from Chile
Thank you
Thanks a lot ❤
love you bro
Could you please post a detailed video for correlated subqueries?
🤩🤩🤩🤩🤩🤩🤩🤩🤩🤩🤩🤩🤩🤩
godlike
the best, thank you
Thank you.
There are two types of subqueries?
the concat function does it have to change the table also
becaues the query is running fine but there are no changes at the schema although i refresh it ]
bro code is a legend, but I think it is better to upload a video illustrating correlated subqueries
This looks like a nested "if" and "loop" statements in Java. I wouldn't be learning those without your tutorials in Java. And I know I will be learning those further when I start learning the other prog. languages you have on your playlist.
Thank you so much!
Goated
Lmao plankton now is the employee of Krusty Krab 😂
wish you could use microsoft data sets
Or you can use a window function
ok i was pretty frustrated until i started this video hearing Bro Code calling the manager as "Krabs" or craps? is this intentional? Bor Code is my type!
What about subqueries inside FROM?
I'm from the google data analytics programme and the instructor taking this part of the course is the worst ever. I didn't struggle understanding others but oh well, i have to use other resources to understand what she's saying. Very ambiguous
Thanks anyway Bro
incredibly loud
Bro is carring us
Lmao this guy should open a how to give actual good examples course