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

Read More
How to Avoid SQL Divide by Zero

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

Read More
How to Subtract 30 Days from a Date using SQL

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

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

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

Read More
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

Read More
Database Design In Four Steps – Build the Sample PizzaDB

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

Read More
SQL Joins – The Ultimate Guide

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

Read More
Data Modeling Principles in Action

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

Read More
Database Normalization – in Easy to Understand English