Class Outline

This two-day, instructor-led course provides the foundational skills to write scripts in Structured Query Language to query your database efficiently and effectively.  If you have inherited scripts, you may find that they are no longer effective, or that they are overly complicated.  You may have found yourself in a position where you have had to rely on others to edit existing scripts for you to make them appropriate for your querying needs.  Or, you know how to do some editing, but you would rather understand the basics of what you are doing as confidence builds success.

The training covers these topics:

What is Structured Query Language (SQL)?

  • Relational Databases
  • Basic SQL Keywords
  • Tips for Planning Queries
  • What People Do with Queries
  • Understanding Data Types
  • SQL Platforms

Selecting Data

  • Using SELECT Statements to Examine Database Tables
  • Using Results to Figure Out Other Tables to Examine
  • Using Comments in SQL Code
  • Narrowing you SQL Statements Down to Fields
  • Sorting Records
  • Using Field Aliasing
  • Saving a SQL Statement

Retrieving Data from Multiple Tables

  • Inner and Outer Joins
  • Table Aliasing
  • Self Joins

Using Criteria in SQL Statements

  • Avoiding Ambiguous Situations
  • Using a Single Criterion to Limit Records
  • AND/OR Situation in Criteria
  • Criteria Keywords
  • Using Comparison Criteria
  • Using Wildcards

Generating Totals Using SQL

  • Aggregate Keywords
  • The GROUP BY Clause
  • Finding Top N Values
  • Using Offset and Fetch to Limit Rows Returned
  • Using Criteria in Aggregate-Based Queries

Generating Calculated Fields Using SQL

  • Math Calculations
  • Using SQL Keywords to Enhance the Display of Data
  • Date Calculations
  • Text Calculations

Unions, Subqueries, and More Joins

  • Using a Where Clause as an Inner Join
  • Using Unions
  • Using Intersect and Except without Using Joins
  • Using Subqueries
  • Matching Conditions with Subqueries

Action Queries

  • Using the Insert Keyword
  • Using Update Statements
  • Using the Delete Keyword

Advanced SQL Functions

  • Replacing NULL Values
  • Comparing Expressions
  • Returning Multiple Rows without Self-Joins
  • Updating Contents in a String

Conditional Queries

  • Using an IF Statement
  • Using a Case Statement
  • Using the While Statement

Data Types for SQL Server

  • String Data Types
  • Numeric Data Types
  • Date and Time Data Types
  • Other Data Types