Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
The final video in this stage will recap what we learned about subqueries and then back to the SQL playground for some more practice.
Subqueries are one of the most advanced concepts to learn in SQL query writing. Seeing lots of examples and getting lots of practice will help solidify the concept.
As you begin using subqueries, be advised that a poorly structured subquery written against a large table or tables can impact overall query performance. Be careful if you are writing subqueries against data sets that consume tables with row counts in the million-plus row range.
Correlated Subqueries
This course does not cover the concept called Correlated Subqueries, which are slightly different in how they tie in with the outer query. Most of the time a regular subquery will do what you need, but correlated subqueries can be handy, too. These are especially heavy weight on the database engine, as they run the subquery many times; once per row in the outer query.
Geeks For Geeks: Correlated Subqueries
Cheat Sheet
See all of the SQL used in Querying Relational Databases in the Querying Relational Databases Cheat Sheet.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Wael Elsisi
211 Points1 Answer
-
Philip Porwisch
13,229 Points1 Answer
-
fairest
Full Stack JavaScript Techdegree Graduate 19,303 Points2 Answers
-
Remi Vledder
14,144 PointsSubquery 'loans challenge': Feedback on this solution
Posted by Remi VledderRemi Vledder
14,144 Points1 Answer
-
PLUS
Sharina Jones
Courses Plus Student 18,771 Points1 Answer
-
Harris Handoko
3,932 Points4 Answers
-
D Elis
13,571 Points2 Answers
-
jlampstack
23,932 Points2 Answers
-
Philip Schultz
11,437 Points2 Answers
-
Sean Flanagan
33,236 Points1 Answer
-
Donnie Driskell
2,243 Points4 Answers
-
James Kruk
1,600 Points2 Answers
-
drstrangequark
8,273 Points1 Answer
-
drstrangequark
8,273 Points2 Answers
-
Danny Zhang
2,014 Points1 Answer
-
Allan Oloo
8,054 Points5 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up