Skip to content
Simple SQL Tutorials

Simple SQL Tutorials

Your guide to querying and developing SQL Server databases

  • Home
  • Tutorials
    • The Basics
    • Transactions
    • Normalization
    • Querying data
    • Developing Databases
    • SQL Questions
    • Identity Property
    • JOIN
    • Data Types
    • Stored Procedures
    • Window functions
    • Data Definition Language
    • Views
    • Constraints
    • Set Operators
    • Table Expressions
    • Error Handling
    • Functions
    • Indexes
    • Triggers
  • Products
  • Contact
  • Privacy Policy
  • About

Querying data

SQL Server Temp Tables: A How-To Guide for Beginners

Posted on August 15, 2022August 17, 2023 by Josh D
SQL Server Temp Tables: A How-To Guide for Beginners

Reading Time: 7 minutesSQL Server temp tables are very useful tools available to us when it comes to querying and developing SQL Server databases. Temp tables offer a very easy way to create a table for a singular purpose and then remove that table when we are finished with it. In this very brief Continue Reading

Posted In Querying data, Stored Procedures

SQL Server IN Clause: Explained with Examples

Posted on July 25, 2022August 17, 2023 by Josh D
SQL Server IN Clause: Explained with Examples

Reading Time: 2 minutesThe SQL Server IN clause is a very helpful tool we can use to simplify our queries. In this very brief tutorial, we’ll discuss how the IN clause works and provide examples of it’s use. Take the following Books table: What if we wanted to write a query where we Continue Reading

Posted In Querying data

How to break a WHILE loop in SQL Server: Explained with Examples

Posted on July 11, 2022August 17, 2023 by Josh D
How to break a WHILE loop in SQL Server: Explained with Examples

Reading Time: 2 minutesThe task of breaking a WHILE loop in Microsoft SQL Server is very simple. We basically break a while loop when we want to terminate the loop early. That is, earlier than the loop would have ended if left to it’s natural progression. To break a WHILE loop early, just Continue Reading

Posted In Error Handling, Querying data, The Basics

How to find a SQL Server column name: Run this one simple query!

Posted on May 16, 2022June 30, 2022 by Josh D
How to find a SQL Server column name: Run this one simple query!

Reading Time: 3 minutesIf you have a particularly large database, finding a specific column might be a bit of a challenge. Maybe you don’t recall exactly what the column name is, and you’re not sure what table it belongs to. Luckily, Microsoft SQL Server has some build in system tables that can help Continue Reading

Posted In Data Definition Language, Querying data, SQL Questions

How To Get a Running Total of Your SQL Data: Explained for Beginners

Posted on May 2, 2022June 30, 2023 by Josh D
How To Get a Running Total of Your SQL Data: Explained for Beginners

Reading Time: 5 minutesIn this very brief tutorial, we’ll discuss how to gather a very particular kind of SQL data: A running total. The best way I found to gather a running total (sometimes called a rolling total) of SQL data is to… Use the SUM() aggregate window function There might be other Continue Reading

Posted In JOIN, Querying data, SQL Questions, Window functions

SQL Server NULLIF: Explained for Beginners

Posted on April 25, 2022August 17, 2023 by Josh D
SQL Server NULLIF: Explained for Beginners

Reading Time: 5 minutesThere are many ways we can compare the equivalency of two values in Microsoft SQL Server. We can use the regular equals ( = ) operator in an IF statement, for example, or we can use the handy CASE statement within the column list of a SELECT statement. But there Continue Reading

Posted In Error Handling, Querying data, Window functions

Do you know this rule about the CAST function?

Posted on April 18, 2022August 17, 2023 by Josh D
Do you know this rule about the CAST function?

Reading Time: 3 minutesThe CAST() system function is one of the most useful tools we have available to us in Microsoft SQL Server. We basically use it to convert a value from one data type to another on-the-fly. I was using CAST() in a query recently and encountered an interesting problem. If you Continue Reading

Posted In Data Types, Querying data, SQL Questions

FULL OUTER JOIN: The Ultimate Guide for Beginners

Posted on April 18, 2022August 17, 2023 by Josh D
FULL OUTER JOIN: The Ultimate Guide for Beginners

Reading Time: 8 minutesOne of the most common tools we use when querying SQL Server databases is the JOIN operation. There are many different kinds of JOIN operations in SQL Server, including: INNER JOIN LEFT OUTER JOIN RIGHT OUTER JOIN CROSS JOIN In this very brief tutorial, we’ll discuss a fifth type of Continue Reading

Posted In JOIN, Querying data

RIGHT JOIN in SQL Server: Explained for Beginners

Posted on April 11, 2022August 16, 2023 by Josh D
RIGHT JOIN in SQL Server: Explained for Beginners

Reading Time: 7 minutesThe JOIN operation in SQL Server is probably one of the most widely used querying tools available to us in Microsoft SQL Server. It is very important that you how JOINs work and the differences between the different types of JOINs. One type of JOIN is the RIGHT JOIN. In Continue Reading

Posted In JOIN, Querying data, The Basics

CROSS JOIN in SQL Server: Explained for Beginners

Posted on March 14, 2022August 16, 2023 by Josh D
CROSS JOIN in SQL Server: Explained for Beginners

Reading Time: 4 minutesKnowing how JOIN operations work in SQL Server is extremely important. I would say most of the queries you will ever right in your career as a database professional will involve some kind of JOIN operation. The INNER and LEFT JOINS are the most common, but it’s also important to Continue Reading

Posted In JOIN, Querying data

Posts pagination

Previous 1 2 3 4 … 6 Next

Tutorial Categories

Navigation:

Home » Querying data » Page 3

Sign up for our newsletter!

Recent Posts

  • “Why should I save my query as a View instead of a .SQL file?” Answered!
  • SQL Server DELETE vs. TRUNCATE: What’s the difference?
  • SQL Server COALESCE System Function: How It Works
  • Can we create indexes in table variables? YES WE CAN!
  • SQL Server WINDOW Clause: Explained!
Copyright All rights reserved. Theme: Flash Blog by Unitedtheme.
SimpleSQLTutorials.com uses cookies to provide the best experience on our website through tailored advertising. By clicking Accept, you agree to our use of cookies.