The examples for SQL Server either use the Adventure Works database or Pizza DB.
You can get started learning SQL Server here we’re we’ll also get you going with the AdventureWorks database.
Recommended Articles:
- Database Design In Four Steps – Build the Sample PizzaDB
- Database Normalization – in Easy to Understand English
If you already have SQL Server installed on your computer or in the cloud, then be sure to get the script for PizzaDB so you can try those samples as well.
Learn how to use the ROW_NUMBER() windows function to generate a unique ID. Problem: You have a table named Teams with information
Problem We want to compare two moving averages in SQL. We’ll use window functions to do this, as it is easier write
Problem You want to remove duplicates in SQL. You know it is easy to find duplicates using GROUP BY, but how do
Problem You need to find duplicates and then identify the records by their primary keys. Background Here’s an example of how to
Problem How do you create a moving average using windows functions in SQL? Background There is no built-in function to create a
Problem How do you create a running total on a column using SQL? Background There is no built-in function to create a
Introduction Window functions are an essential tool for data analysis, particularly in the SQL language. They allow you to perform complex calculations,
In this article let’s look at window functions vs GROUP BY queries. We’ll do so by looking at how each statement works
So what happens when you create a view, and then later someone else changes the underlying tables? In this article let’s explore
In this article I’ll show you three ways you can use SQL to concatenate columns into a single expression. You’ll see as
Problem Statement Getting data loaded into your SQL Server tables can come in a variety of methods. There are many mechanisms that
Problem You want to round up to the nearest integer. Background Suppose you have a list of final sales amount that you
Recently a student asked me how he could calculate a Moving Median. It’s not as easy as you think, as SQL doesn’t
Problem You need use SQL to calculate the Median of a result from SQL Server. Background Suppose you need to calculate the
Problem You need to avoid SQL divide by zero errors. Suppose you need to calculate velocity using the formula v = s
Problem Given a date, you want to subtract 30 days in the past using SQL. Said another way, get the date thirty
Problem You need to figure out the week number from date, assuming Monday is the first day of the week using PostgreSQL,
Problem You want to replace all occurrences of a substring with a new substring using PostgreSQL, MySQL, or SQL Server. Background The
In this article we are going to design and create a sample relational database you can use with MySql, PostgreSQL or Microsoft
SQL Joins are important to master. As you progress from a beginner to advanced beginner, you’ll soon need to combine data from
In this puzzle, we’re going to learn how to do some basic data modeling. Many of you have expressed an interest in
Database normalization is a process used to organize a database into tables and columns. There are three main forms: first normal form
Select Top Rows In this video we’ll walk you though how to select top rows within a query. We’ll show you
The main purpose of a SQL CASE expression returns a value based on one or more conditional tests. Use CASE expressions anywhere