CST363 • Week 3

← Back to all posts

Getting More Comfortable with Subqueries

September 20, 2026

This week felt like a step up from the SQL review we had been doing because we started combining more concepts into the same problems. A lot of my time went into Labs 5 and 6, where I practiced joins, self-joins, subqueries, correlated subqueries, EXISTS, aggregation, and CTEs. None of the individual pieces felt impossible, but I definitely had to slow down more when a query had several layers to keep track of.

Subqueries were probably the biggest focus for me this week. I'm getting more comfortable recognizing when it makes sense to solve part of a problem with an inner query first instead of trying to force everything into one large join. Correlated subqueries still take me a little more time to read because the inner query depends on the current row from the outer query, but working through examples helped make that relationship clearer.

We also started using Python with database-style data again, which was a nice change of pace from writing only SQL. One of the lab tasks involved building a dictionary from query results, and another involved combining data in Python in a way that worked similarly to a LEFT JOIN. I liked seeing the same ideas represented in both SQL and Python because it made the purpose of the operations easier to understand.

This week definitely felt more challenging to me than the previous one, but in a good way! I'm starting to feel more comfortable breaking larger database questions into smaller pieces instead of trying to write the entire query perfectly on the first attempt.

Comments

Join the conversation for this post.

No comments yet. Be the first to comment.