Reading Time: 7 minutesThe WHILE loop is one of the most basic tools you should know when you are first starting out with Microsoft SQL Server. Sometimes when working with SQL Server, you need certain code to execute several times in a loop while some condition is true. As soon as that condition Continue Reading
The Basics
SQL Server Wildcards: The 5 wildcards you need to know
Reading Time: 9 minutesYou are the manager of a new up-and-coming hardware store in the city of Denver, Colorado. You are speaking with a new customer who says they own a woodworking business, and enjoy shopping at your store very much. They plan on being a regular customer, which you know will bring Continue Reading
The difference between COUNT(*) and COUNT(column): Answered!
Reading Time: 6 minutesWhen I was first starting out with SQL Server, I had a hard time understanding the difference between COUNT(*) and COUNT(column), and how they are used with the GROUP BY clause. Many times, the COUNT(*) function would return the same results as the COUNT(<column>) function, so I just told myself Continue Reading
SQL Server NULL: Are you making these 7 mistakes?
Reading Time: 11 minutesA proper understanding of NULL is absolutely essential for writing accurate queries that return accurate results. When you are first starting out with SQL Server, you might have these assumptions about NULL that are not quite right, or maybe flat out WRONG. If you misunderstand how SQL treats NULL, you Continue Reading
The IF…ELSE IF….ELSE Statement: Everything You Should Know
Reading Time: 8 minutesThe IF…ELSE and the IF…ELSE IF…ELSE structures are the most basic decision structures you should know if you are just starting out with SQL or any other programming/query language. If you are familiar with other languages besides SQL, you will already be familiar with the concept of decision structures. But Continue Reading
HAVING Clause: How it works
Reading Time: 6 minutesThe HAVING clause is a very useful tool we can use when querying SQL Server databases. When I was first learning SQL, I had a tough time understanding the HAVING clause. Looking back, I’m not sure what was so difficult to understand. It’s actually very simple. Are you struggling to Continue Reading
GROUP BY clause: A How-To Guide
Reading Time: 9 minutesWhen you are first learning how to query SQL Server databases, you might find yourself thoroughly confused by the GROUP BY clause. I know I was, for sure. You might ask yourself questions like: “What columns am I allowed to use in the SELECT list?” “Can I put more than Continue Reading
The B-Tree: How it works, and why you need to know
Reading Time: 11 minutesIf you had to explain what a B-Tree is and how it works, could you do it? I mean, you know it’s a thing in SQL Server, and it is part of indexes (…somehow), but do you really know what it is? Wood you beleaf me if I told you Continue Reading
Set Operator Precedence: Explained
Reading Time: 7 minutesIn this tutorial, we will discuss a very useful topic you should know when querying SQL Server databases: Set Operator precedence. The three set operators available to us in SQL Server are UNION, INTERSECT, and EXCEPT. I have in-depth tutorials on all 3 different set operators, found there: The UNION Continue Reading
SQL Server EXCEPT: Everything You Need to Know
Reading Time: 10 minutesIn this tutorial, we’re going to learn about a very common Set Operator you should know: The EXCEPT Set Operator. Set operators are one of the more common tools we have available to us when querying SQL Server databases. It is important you know how to write them, and how Continue Reading