## How to Round Up to Nearest Integer

Problem You want to round up to the nearest integer. Background Suppose you have a list of final sales amount that you

How to Round Up to Nearest Integer

## Calculate Moving Median in SQL

Recently a student asked me how he could calculate a Moving Median.  It’s not as easy as you think, as SQL doesn’t

Calculate Moving Median in SQL

## Use SQL to Find the MEDIAN

Problem You need use SQL to calculate the Median of a result from SQL Server. Background Suppose you need to calculate the

Use SQL to Find the MEDIAN

## How to Avoid SQL Divide by Zero

Problem You need to avoid SQL divide by zero errors. Suppose you need to calculate velocity using the formula v = s

How to Avoid SQL Divide by Zero

## How to Subtract 30 Days from a Date using SQL

Problem Given a date, you want to subtract 30 days in the past using SQL. Said another way, get the date thirty

How to Subtract 30 Days from a Date using SQL

## How to Find the Week Number in PostgreSQL, MySQL, and SQL Server

Problem You need to figure out the week number from date, assuming Monday is the first day of the week using PostgreSQL,

How to Find the Week Number in PostgreSQL, MySQL, and SQL Server

## Replace using PostgreSQL

Problem You want to replace all occurrences of a substring with a new substring using PostgreSQL, MySQL, or SQL Server. Background The

Replace using PostgreSQL

In this article we are going to design and create a sample relational database you can use with MySql, PostgreSQL or Microsoft

## CREATE TABLE SQL

You can use the SQL CREATE TABLE command to create a new table in the database.  When you create a table you

CREATE TABLE SQL

## How to Get Today’s Date

Problem You want to use today’s date in your SQL query, but don’t want to type it in each day. Solution You

How to Get Today’s Date

## How to Get a Date 30 Days into the Future using SQL

How to Get a Date 30 Days into the Future. Problem You want to calculate a date 30 days into the Future

How to Get a Date 30 Days into the Future using SQL

## How to do an Impossible Join with String Split

In this article I’ll show you how to use STRING_SPLIT() to join two tables.  I call this the impossible join. I’ve come

How to do an Impossible Join with String Split

## Contains in SQL

Sooner or later, you want to know when a column contains in SQL another value.  In this article we’ll go over several

Contains in SQL

## What are the Top Ten Databases?

Everyone has their favorite DBMS, is your favorite one of the top databases? Though some non-relational products have entered the top ten,

What are the Top Ten Databases?

## Ten Things a Junior DBA Should Learn

There is more to being a Junior DBA than knowing SQL.  The DBA works at the intersection of the database, server, operations

Ten Things a Junior DBA Should Learn

## What is a SQL Trigger?

What is a Database Trigger? A SQL trigger is special stored procedure that is run when specific actions occur within a database.

What is a SQL Trigger?

## SQL HAVING Tutorial

Use SQL HAVING to filter summary results from a GROUP BY.  It specifies the search condition for the group or aggregate. SQL

SQL HAVING Tutorial

## SQL GROUP BY Guide

Use the SQL GROUP BY Clause is to consolidate like values into a single row.  The group is a set of columns. The group

SQL GROUP BY Guide

## SQL SUM Function

The SQL SUM function returns the total value within a table or group. In its simplest use, SUM() totals a column for all results and returns a

SQL SUM Function

## What is the difference between WHERE and HAVING clauses?

In this article learn when to use WHERE and HAVING.  Both perform similar functions, but for different purposes! All the examples for

What is the difference between WHERE and HAVING clauses?

## SQL WHERE LIKE

In this article you’ll learn to use the LIKE operator in your SQL. In most situations you’ll find yourself using LIKE within

SQL WHERE LIKE

## How do I use the Like Clause in SQL Server?

In this video we’ll walk you though how to use the LIKE clause.   We’ll show you how to you can perform

How do I use the Like Clause in SQL Server?

## SQL WHERE – Guide and Examples

In today’s lesson, you’re going to learn how to filter query results using the SQL WHERE clause.  This clause is important as

SQL WHERE – Guide and Examples

## Use SQL ORDER BY to Sort Results

The SQL ORDER BY clause is used to sort your query result in ascending or descending order. Once you have written a

Use SQL ORDER BY to Sort Results

## What is the Difference between TOP and OFFSET & Fetch?

Both TOP and OFFSET & FETCH can be used to limit the number of rows returned.  OFFSET and FETCH can return similar

What is the Difference between TOP and OFFSET & Fetch?