Reading Time: 4 minutesIt is very easy to write a DELETE statement with a JOIN. In this very brief tutorial, we’ll walk through how it’s done. We’ll go over just these two topics: Write it as a SELECT statement first Convert your query to a DELETE statement Everything in this tutorial can also Continue Reading
JOIN
Don’t make this OUTER JOIN mistake!
Reading Time: 4 minutesThe OUTER JOIN operations, such as LEFT JOIN and RIGHT JOIN, are very important to know when it comes to querying Microsoft SQL Server databases. There is one important factoid you should know if you are using an OUTER JOIN in combination with the IS NULL predicate. Let’s create a Continue Reading
How To Get a Running Total of Your SQL Data: Explained for Beginners
Reading Time: 5 minutesIn this very brief tutorial, we’ll discuss how to gather a very particular kind of SQL data: A running total. The best way I found to gather a running total (sometimes called a rolling total) of SQL data is to… Use the SUM() aggregate window function There might be other Continue Reading
FULL OUTER JOIN: The Ultimate Guide for Beginners
Reading Time: 8 minutesOne of the most common tools we use when querying SQL Server databases is the JOIN operation. There are many different kinds of JOIN operations in SQL Server, including: INNER JOIN LEFT OUTER JOIN RIGHT OUTER JOIN CROSS JOIN In this very brief tutorial, we’ll discuss a fifth type of Continue Reading
RIGHT JOIN in SQL Server: Explained for Beginners
Reading Time: 7 minutesThe JOIN operation in SQL Server is probably one of the most widely used querying tools available to us in Microsoft SQL Server. It is very important that you how JOINs work and the differences between the different types of JOINs. One type of JOIN is the RIGHT JOIN. In Continue Reading
LEFT JOIN and LEFT OUTER JOIN: What’s the difference?
Reading Time: 2 minutesThe JOIN operations can be a bit tricky in Microsoft SQL Server. If you are new to SQL Server, you might be trying to understand the different JOIN operations and how they work. You probably have some basic questions you’d like answered. When I was first starting out with SQL Continue Reading
CROSS JOIN in SQL Server: Explained for Beginners
Reading Time: 4 minutesKnowing how JOIN operations work in SQL Server is extremely important. I would say most of the queries you will ever right in your career as a database professional will involve some kind of JOIN operation. The INNER and LEFT JOINS are the most common, but it’s also important to Continue Reading
UPDATE statement with JOIN: How it’s done
Reading Time: 8 minutesOne of the more tricky things I learned early in my career was how to do an UPDATE statement with a JOIN. This is a very interesting task to think about. There may be situations when we want to perform an UPDATE to the results of a JOIN query, such Continue Reading
Top 6 tools you should know for writing AWESOME Select statements
Reading Time: 13 minutesAs a database professional, you will be asked to come up with SELECT statements to pull needed information in a meaningful and accurate way. Sometimes you will need to review other SELECT statements written by other people, too. Maybe those queries have a problem which is causing it to pull Continue Reading
What’s the difference between JOIN and LEFT JOIN? This and other JOIN questions, answered!
Reading Time: 6 minutesWhen I was first learning how to query databases using T-SQL, I had some very basic questions about the different JOIN operations. I had questions like: “What’s the difference between a JOIN and a LEFT JOIN?” Or “What’s the difference between a regular JOIN and an INNER JOIN?” Or even Continue Reading