OMG, I was struggling with Nested subqueries, but now I certainly have a better insight about it. Thank you so much and the person who shared your video in a forum.
Mike... You are the M-A-A-AN!!! Thank you, so much! This was so clearly and simply esplained! On top of everything, I was working on understanding the consecutiveness of the steps machine is working in, as it evaluates the query, and I saw, (in my mind), that it worked from inside-out of the parentheses - in other words, from within the innermost parentheses' query, gradually, toward the outermost query - but, I had seen some conflicting, (to a novice, like me), explanations and examples before, and wasn't entirely clear on this. And YOU, Sir, did it so clearly, and eloquently! Thank You!
believe it or not our database design lecturer did not use practical example like this and just read of what syntaxes does from textbook. holy i just understood it in a minute!
If in client there was not mng_id, is that a good query for the last exercise? SELECT client_id, client_name FROM client WHERE client_id IN ( SELECT client_id FROM works_with WHERE emp_id IN( SELECT emp_id FROM employee WHERE super_id IN ( SELECT mgr_id FROM branch WHERE mgr_id IN ( SELECT emp_id FROM employee WHERE employee.first_name = 'Michael' AND employee.last_name = 'Scott' ) ) OR (first_name = 'Michael' AND last_name = 'Scott') ) )
I liked the vid. You explain very well! However, isn't it a video for subqueries? I'm new to SQL but i'm under the impression you would have to go one step inner to get a nested query, right?
So, is it bad I didn't recognize the "re-brand" and my first thought was come on some guy stole "Mike's" video?? And, here I was going to subscribe. After a brief look at the videos, I realized my mistake and pounded that sub button. Because anyone with a hunger for computer knowledge this is a good place to start. The tutorials are simple and easy to follow for beginners and more advanced users.
Yes, a very good question. I would have used a table join for the first example in this tutorial, but as I'm relatively new to SQL, I assumed there was either a good reason not to, OR he was merely trying to demonstrate a principle.
Assuming you don't know Michael Scott's ID: -- Clients handled by Michael Scott's branch SELECT client_name FROM client WHERE branch_id IN (SELECT branch_id FROM branch WHERE mgr_id IN (SELECT emp_id FROM employee WHERE first_name = "Michael" AND last_name = "Scott")); -- Or you can do SELECT client_name FROM client WHERE branch_id IN (SELECT branch_id FROM branch WHERE mgr_id IN (SELECT emp_id FROM employee WHERE CONCAT(first_name, " ", last_name) = "Michael Scott"));
Hi, thanks for the video! Sorry I don't get it why in the first example you were using 'IN', while in the 2nd example you were using '='? Can you explain a little detail, please? Thanks.
May I asked why you would not use an IN with the client branch ID in the where clause, I don’t understand why parenthesis would used in this sense. Thank you
Explanation are helpful but I do have one question.. isn't the first question to find out employees for a single client.. not sure the query address the question
I guess he means all employees who have sold +3k to one client (not a specific client). So if we have an employee who sold 1500 to a client and 1500 to another client should not be counted
I have an exam tomorrow this whole nested queries thing can get pretty complicated if you dont under stand the basics of the dos and don'ts and when to use certain functions with nested queries.
if you dont assume you know michael scott id cant you just do it through employee table? for exp select client.client_name from client where client.branch_id = ( select employee.branch_id from employee where first_name='Michael' and last_name='Scott' //you could use LIKE instead of = limit 1);
Very clearly explained. I'm just getting to grips with SQL, so forgive my ignorance! Would you use a nesting approach if you wanted to retrieve relational data for over 1000 items using Oracle where you can't input more than 1K items in a single search? Or is there a more efficient way of querying large numbers of inputs using Developer? Hope that makes sense :-)
In the very first subquery example, how would you display the client id as well along with employee's first and last name? I am happy if it repeats the name.
Writing the queries separately and then combining them made the logic of nested queries much easier to understand. Nice vid!
Indeed .
This guys way of teaching is amazing
Couldn’t figure out my problem.. watched this video.. then solved my problem in less than 2 mins. Thx dude!
I feel Jim and Dwight sell more than Michael at any given time.
Great video!
OMG, I was struggling with Nested subqueries, but now I certainly have a better insight about it. Thank you so much and the person who shared your video in a forum.
Came for nested queries, stayed for the dataset. Love it thanks
YES!!!! Thank you. This was really clear. Taking my first database class via Zoom, needing all the help I can get lol!
This made me understand the concept of nested queries better and quicker. The approach you conveyed within 5 mins is effective. Thank you so much
THANK YOU! BEST tutorial out there! Had no idea what was going on it class for the past 40 minutes and you sorted it in 10 😂
Hahaha
I come here from the google data analytics professional certificate and this video allowed me to understand this new concept. Thank you very much.
Love how you used people from the Office!!!
I feel I should be contributing to your channel of how beneficial it is to me, thank you, Mike!
Thank you! Your explanation is so clear!
Great tutorials man. I have an internship coming up in just over a week. These videos are making me feel prepped for it.
How'd that go
hey mike, thanks for explaining the complex topic in SQL nested query!
Awesome explanation for nested or subqueries. Thanks so much!
Thanks for simplifying the logic behind this!
Lol love The Office examples. Great informative video
Fantastic videos, all of them. Thank you for doing this.
Mike... You are the M-A-A-AN!!!
Thank you, so much!
This was so clearly and simply esplained!
On top of everything, I was working on understanding the consecutiveness of the steps machine is working in, as it evaluates the query, and I saw, (in my mind), that it worked from inside-out of the parentheses - in other words, from within the innermost parentheses' query, gradually, toward the outermost query - but, I had seen some conflicting, (to a novice, like me), explanations and examples before, and wasn't entirely clear on this.
And YOU, Sir, did it so clearly, and eloquently!
Thank You!
nice video i want this types of more scenerio base questions solutions
Very good breakdown, thank you!
Such a great tutorial.
Thanks, man!
you have helped alot .. clear and understandable explaination
u are so good tbh , very clear
believe it or not our database design lecturer did not use practical example like this and just read of what syntaxes does from textbook. holy i just understood it in a minute!
Love ♥ this tutorial
Keep it up!
Taught me something my teacher couldn't, appreciate it
in these cases would be more simple just using the join statement
Great explanation!!!
Awesome video, thanks so much
Wow.... what a clarity of explanation
This was so helpful! Thanks
Great video 👍🏽
Great content, thanks.
Please make mor vedios on Database we need it!
Thank you. It really helps!
Great video!!!👏
Can I just say a HUGE thank you as I was stuck on this one coursework question
Subscribed!!! Great videos with C and now SQL.
omg, this is better than my professor
Thanks, Dane, you're Great.
Great video! Step by step, clear, organized! good job! Just subscribed!
Great sir❤🎉
Can we also just use an inner join?
Select * from employee inner join works_with where total_sales > 30,000 ?
I'm new to this stuff and wondering the same thing..
Any answers?
yes it gives the same result
Any nested correlated query can be rewritten as a normal query, it says in the book Fundamentals of Database Design.
Very helpful. Than you.
If in client there was not mng_id, is that a good query for the last exercise?
SELECT client_id, client_name
FROM client
WHERE client_id IN (
SELECT client_id
FROM works_with
WHERE emp_id IN(
SELECT emp_id
FROM employee
WHERE super_id IN (
SELECT mgr_id
FROM branch
WHERE mgr_id IN (
SELECT emp_id
FROM employee
WHERE employee.first_name = 'Michael' AND employee.last_name = 'Scott'
)
) OR (first_name = 'Michael' AND last_name = 'Scott')
)
)
Being an office fanatic....i understood it better🤣👍👌
Great video, just one problem though. You do not have Dwight in the employee table. :)
nice explanation 😇 sir
I liked the vid. You explain very well! However, isn't it a video for subqueries? I'm new to SQL but i'm under the impression you would have to go one step inner to get a nested query, right?
your explanation helps me a lot, thank you so much!
So, is it bad I didn't recognize the "re-brand" and my first thought was come on some guy stole "Mike's" video?? And, here I was going to subscribe. After a brief look at the videos, I realized my mistake and pounded that sub button. Because anyone with a hunger for computer knowledge this is a good place to start. The tutorials are simple and easy to follow for beginners and more advanced users.
When is it more appropriate to use a nested query over a join? Or is it preference?
Great question
Anyone?
literally my question and I can't find an answer either :)
Yes, a very good question. I would have used a table join for the first example in this tutorial, but as I'm relatively new to SQL, I assumed there was either a good reason not to, OR he was merely trying to demonstrate a principle.
Very Well Explained Sir ♥️♥️ Thank You
You are a Star...
Life was good when we were giraffe academy's students
Thank you. Help a lot
Amazing tutorial
very nicely explained thank you
Thanks, good video
Just wow ❤🙏🙏🙌
Great explanation! Thank you.
Assuming you don't know Michael Scott's ID:
-- Clients handled by Michael Scott's branch
SELECT client_name FROM client WHERE branch_id IN
(SELECT branch_id FROM branch WHERE mgr_id IN
(SELECT emp_id FROM employee WHERE first_name = "Michael" AND last_name = "Scott"));
-- Or you can do
SELECT client_name FROM client WHERE branch_id IN
(SELECT branch_id FROM branch WHERE mgr_id IN
(SELECT emp_id FROM employee WHERE CONCAT(first_name, " ", last_name) = "Michael Scott"));
thanks, wonderful session.
Hi, thanks for the video! Sorry I don't get it why in the first example you were using 'IN', while in the 2nd example you were using '='? Can you explain a little detail, please? Thanks.
can you give more questions for nested queries?
This was lit 🔥 Thank u bruh...
thnk u so much sir
Thank you for the explanation ! :D
Thank you!
I wish I can give a million likes for this video. Thank you.
May I asked why you would not use an IN with the client branch ID in the where clause, I don’t understand why parenthesis would used in this sense. Thank you
Can you make video of if condition and while loop as well please
Explanation are helpful but I do have one question.. isn't the first question to find out employees for a single client.. not sure the query address the question
I guess he means all employees who have sold +3k to one client (not a specific client). So if we have an employee who sold 1500 to a client and 1500 to another client should not be counted
We can use inner join
Thank you very much bro....
You are the best man ,👌
Thanks you
I have an exam tomorrow this whole nested queries thing can get pretty complicated if you dont under stand the basics of the dos and don'ts and when to use certain functions with nested queries.
Hi, I liked working on the data camp, are there any websites with a lot of tables and questions to solve more problems and practice?
if you dont assume you know michael scott id cant you just do it through employee table?
for exp
select client.client_name from client
where client.branch_id = (
select employee.branch_id from employee
where first_name='Michael' and last_name='Scott'
//you could use LIKE instead of =
limit 1);
Great video, but how dare you not even include Dwight in the employee table
Very clearly explained. I'm just getting to grips with SQL, so forgive my ignorance! Would you use a nesting approach if you wanted to retrieve relational data for over 1000 items using Oracle where you can't input more than 1K items in a single search? Or is there a more efficient way of querying large numbers of inputs using Developer? Hope that makes sense :-)
thank you so much!
6:11 why it is called foreign key?
great job! Contributed!
Thank you so much dude
respect!
Can you do this if your trying to pull from separate dbos? Or do I have to create a view with the info from each dbo I need?
To make it simple, why don't use "in" in all cases?
bravo
my profs couldn't even explain this as clear and you, and i paid her for the class.........
In the very first subquery example, how would you display the client id as well along with employee's first and last name? I am happy if it repeats the name.
Please come back Mike!
Great examples, how can one play with that data (online practice
Would it make a huge difference if the branch manager query was the outer query, and the client withing the nested query?
Can you do another video on a nested query but with group by? I am trying to use SQL to count adverse events for a clinical trial.
Can't watch the video... There is an error when I try to play it.
Just 30 minutes ago, I upload a doubt. With the help of a mate, I got the answer right the way, great community!
i need this with calculated columns. any suggestions?