Microsoft SQL Server 2012 Querying Data for Report Developers

3 days

Course Overview

This 3 day course is intended for students who need to familiarise themselves with the various querying
techniques available to retrieve data from a Microsoft SQL Server database in a report authoring
environment, whether that be through an implementation of Microsoft SQL Server Reporting Services
or similar reporting tool. No previous knowledge of the SQL language is assumed as the course is
designed from the ground up, starting with basic queries and advancing to more complex querying
methods. The last module will also give students the opportunity to put their SQL skills into practice by
creating a simple report. On completion of the course students will be able to retrieve data using the
SQL language and write effective queries for reporting purposes.

Course Objectives

Upon successful completion of this course, students will be able to:

  • Understand SQL Syntax
  • Retrieve, Filter and Sort Data
  • Work with the SQL Server Date and Time Data Types
  • Query Data from Multiple Tables by Using Joins
  • Summarize and Rank Grouped Data
  • Combine and Limit Result Sets
  • Work with Subqueries
  • Implement Stored Procedures
  • Implement SQL Code to Create a Simple Report


Students should ideally be familiar with basic programming concepts, and understand the fundamental
design of relational databases and data normalization.

Course Outline

1. Introduction to SQL Server Management Studio

  • Objects in a SQL Server Database
  • Database Diagrams
  • Components of a SQL Server Database Table

2. Introduction to SQL and Transact-SQL

  • ANSI-SQL and Transact-SQL (T-SQL)
  • Categories of SQL Statements
  • T-SQL Scripts
  • Adding Comments to T-SQL Code

3. Using the SELECT Statement to Retrieve Data

  • Examine the Basic Syntax of the SELECT Statement
  • Using String Literals and Expressions
  • Retrieving Columns of Data from a Table
  • Using Aliases for Column Names

4. Retrieving Specific Rows of Data Using the

  • WHERE Clause
  • How to Use the WHERE Clause
  • Overview of Operators
  • Filter Data by Using Comparison Operators
  • Filter Data by Using String Comparisons
  • Filter Data by Using Logical Operators
  • Filter Data Using a Range of Values
  • Filter Data Using a List of Values
  • Working with NULL Values
  • Introducing Native SQL Server Functions
  • Functions Relating to NULL Values

5. Working with SQL Server Data Types

  • Native SQL Server Data Types
  • Working with Variables
  • Data Type Precedence
  • Implicit Data Type Conversions
  • Explicit Data Type Conversion Functions
  • Querying and Modifying Date and Time Data
  • Native SQL Server Date and Time Functions

6. Formatting and Sorting Result Sets

  • Sorting Data Using the ORDER BY Clause
  • Eliminating Duplicate Rows with DISTINCT
  • Using the CASE Expression

7. Querying Data from Multiple Tables Using Joins

  • Introduction to Joins
  • Using Inner Joins
  • Using Outer Joins
  • Using Aliases for Table Names
  • Joining More than Two Tables
  • Joining a Table to Itself (Self Join)

8. Summarizing Data Using Aggregate Functions

  • Using Aggregate Functions Native to SQL Server
  • Using Aggregate Functions with NULL Values
  • Grouping Summarized Data with GROUP BY
  • Filtering Grouped Data Using the HAVING Clause

9. Ranking Grouped Data

  • Ranking Data Using Ranking Functions
  • Using ROW_NUMBER
  • Using RANK
  • Using DENSE_RANK
  • Using NTILE
  • Summary of Ranking Functions Based on Their
  • Functionality

10. Combining and Limiting Result Sets

  • Combining Result Sets Using the UNION Operator
  • Limiting Result Sets Using the TOP Operator

11. Working with Subqueries

  • Introduction to Subqueries
  • Using Subqueries as Expressions and Derived Tables
  • Using Correlated Subqueries
  • Using the EXISTS Clause with Correlated Subqueries

12. Controlling Program Execution

  • Control-of-Flow Language Statements

13. Implementing Stored Procedures

  • Overview of Stored Procedures
  • How Stored Procedures Are Executed by SQL Server
  • Creating and Using a Stored Procedure
  • Parameterizing Stored Procedures

14. Designing a Simple Report in SSRS

  • Introducing SQL Server Reporting Services (SSRS)
  • Creating a Report Project
  • Creating a Report
  • Creating a Data Source
  • Creating a Dataset
  • Designing a Basic Report