Writing SQL


SQL COALESCE Function

The SQL Coalesce function is used when you want to combine values from a series of columns or expressions when they might contain NULL values.


Using GROUP BY and HAVING

In this post, we discuss how to use the GROUP BY and HAVING clause in a T-SQL statement and how to use them with aggregate functions.


Tables and Relationships

Understanding the difference between Parent Tables and Child Tables and the difference between Primary Keys vs Foreign Keys.



Selecting From Multiple Tables

How to write T-SQL SELECT statements using multiple tables and what are the differences between using Inner Joins, Left Outer Joins, Right Outer Joins, and Full Outer Joins.


SQL Statement Categories

There are four main categories of statements used when writing T-SQL. What are the differences between each of these categories?



Using the INSERT Statement

How to use an INSERT statement to add records to a table in SQL Server. We will begin with just a simple INSERT statement that will add one row into the table.