562 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Posted by Andrew Gould on 31 October 2012
A correlated subquery is a subquery which depends on an outer query for its values. If that doesn't make much sense, this video attempts to explain exactly what that means. You'll see how to build simple correlated subqueries, including why it's necessary to use table aliases, along with an explanation of what happens when you execute the query.
This video has the following accompanying files:
|Create Movies Database with Genre Table.sql||SQL query|
Click to download a zipped copy of the above files.
There are no exercises for this video.
You can increase the size of your video to make it fill the screen like this:
Play your video (the icons shown won't appear until you do), then click on the full screen icon which appears as shown above.
When you've finished viewing a video in full screen mode, just press the Esc key to return to normal view.
To improve the quality of a video, first click on the Settings icon:
Make sure yoiu're playing your video so that the icons shown above appear, then click on this gear icon.
Choose to change the video quality:
Click as above to change your video quality.
The higher the number you choose, the better will be your video quality (but the slower the connection speed):
Don't choose the HD option shown unless your connection speed is fast enough to support it!
Is your Wise Owl speaking too slowly (or too quickly)? You can also use the Settings menu above to change your playback speed.
|When:||07 Apr 21 at 10:17|
Hello Wise Owls,
I do have a question regarding the last case.
If the code in Line 14 is removed, will the output stays the same pls? Since the output is ORDERED BY y, we will always find the results rank by year, right?
Thanks in advance,
|When:||12 Apr 21 at 07:39|
No, the results would be different if you remove line 14 from the last example. Line 14 is what makes this a correlated subquery. Without that line your results would return any film whose run time is longer than the average run time of every film in the table. With line 14 your results return each film whose run time is longer than the average run time of only those films made in the same year.
We aren't ranking results in this example, the ORDER BY clause was added simply to see the results more easily.
I hope that helps!
25 Aytoun Street