Exploring Summer Solstice With SQL

Why is June 21 the official start of summer? Let’s see how SQL can help us answer this question. The Summer Solstice Officially, June 21 is recognized as the summer solstice, the longest day of the entire year in terms of daylight. Why? Because on this day, the sun rises early and sets quite late. People in the Northern Hemisphere celebrate the summer solstice with feasts, bonfires, picnics, and traditional dances and songs. In ancient times, the summer solstice was

Continue Reading

Improving Slow Query Performance: When Runtime Matters

As SQL users, we usually focus on writing queries that return correct results. However, there are more things to consider when you’re writing a query; one of them is query performance. In this article, we’ll look at some examples where query response time is critical. Scene One: 911 Call Center Let’s suppose we’re at a 911 call center, when the phone rings. One of the operators answers the call; a witness reports that a man has been shot. After the

Continue Reading

Converting Subqueries to Joins

Not all queries are alike, especially in terms of performance. In this article, we’ll look at how you can convert SQL subqueries to joins for improved efficiency. When should I use SQL subqueries? Great question! Unfortunately, there’s no concrete answer. SQL beginners tend to overuse subqueries. Typically, once they find that SQL construction works in one situation, they try to apply that same approach to other situations. It’s only natural. However, in some cases a subquery can be replaced with

Continue Reading

SQL Interview: Tips From Recruiter and Sample Questions with Solutions

Applying for an SQL-related position? You’ll likely have to pass an interview process. But you’ll be much better prepared for the interview if you know what to expect. This article sheds some light on the recruiter’s perspective to better prepare you for your interview. SQL Knowledge and Skills There are different SQL skills that an interview can test. These include: Skills related to any specific SQL database engine (like PostgreSQL, MySQL, or Oracle). Skills associated with SQL clients or SQL

Continue Reading

Correlated Subqueries in 5 Minutes

If you’re familiar with the famous Russian nesting doll, then SQL subqueries should be a peace of cake to understand—subqueries are just queries nested within queries. An SQL subquery is often called an “inner” query; the main query is usually called the “outer” query. This article covers everything you need to know about correlated subqueries. What Exactly is a Correlated Subquery? A correlated SQL subquery is just a subquery that is executed many times—once for each record (row) returned by

Continue Reading

GET ACCESS TO EXPERT SQL CONTENT!