Querying Archives

A majority of SQL focuses on querying data.  Makes sense, as that is one of the main purposes of a database!

In this section we’ve collected several categories related to querying, namely:

  • Sorting – Ordering rows by columns and expressions and selecting the top or bottom results.
  • Filtering – The ability to use Boolean logic to select one set of rows with a result over another.
  • Group and Summarize – Use GROUP BY and HAVING to calculate summary data such as averages, summations, minimum and maximum values.

If you’re new to SQL, I would recommend you join our Essential SQL learning group on FB.

All the examples for this lesson are based on Microsoft SQL Server Management Studio and the sample databases AdventureWorks and WideWorldImporters.  You can get started using these free tools using my guide Getting Started Using SQL Server

13

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 this article are based on Microsoft SQL Server Management Studio and the AdventureWorks2012 database.  You can get started using these free tools using my Guide Getting Started Using SQL Server. How do Where and Having Differ? […]

Continue reading
7

How to Filter Query Results

In today’s lesson you’re going to learn how to filter query results using the WHERE clause.  This clause is important as only those records matching the where clause’s conditions are returned in the query results. The objectives of today’s lesson are to: Learn about various condition types, such as Equality, Range, and Membership Comprehensive example […]

Continue reading
>