## 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

## SQL Joins – The Ultimate Guide

SQL Joins are important to master. As you progress from a beginner to advanced beginner, you’ll soon need to combine data from

SQL Joins – The Ultimate Guide

## Data Modeling Principles in Action

In this puzzle, we’re going to learn how to do some basic data modeling.  Many of you have expressed an interest in

Data Modeling Principles in Action

## Database Normalization – in Easy to Understand English

Database normalization is a process used to organize a database into tables and columns. There are three main forms: first normal form

Database Normalization – in Easy to Understand English

## Select the Top Row from your result.

Select Top Rows In this video we’ll walk you though how to select top rows within a query.   We’ll show you

Select the Top Row from your result.

## SQL CASE Statement – Simple and Searched Forms

The main purpose of a SQL CASE expression returns a value based on one or more conditional tests.  Use CASE expressions anywhere

SQL CASE Statement – Simple and Searched Forms