Course Description

SQL Fundamentals of Querying is a 1-day Introduction to SQL training course.  Students will learn about the essentials of using the Structured Query Language (SQL) and how SQL will enable them to access data within a database in order to answer business questions. The course focuses solely on the SQL SELECT command for retrieving data from a Relational Database system such as Microsoft SQL Server, Oracle, MySQL, Sybase, or DB2.

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

  • Define what a relational database is.
  • Identify some uses for the SQL language.
  • Recognise and use proper syntax for an SQL statement.
  • Use aggregate functions and grouping.
  • Apply column aliases, and use mathematical expressions in a query statement.
  • Use the WHERE clause to select specific rows of information from a database.
  • Search for specific character strings or numeric data in a database.
  • Write queries that return both aggregate and non-aggregate information simultaneously.
  • Write queries that select information from two tables simultaneously.
  • Use inner joins, outer joins, and self-joins.
  • Use built-in functions to transform data for output.
  • Use a simple sub-query.

 

Pre-requisites

Ability to use a windowed operating system with mouse and keyboard.

Who is this course for?

Students enrolling in this course should be familiar with using a windowed operating system (eg Windows, Linux, Mac OS) to interact with stored data. They should also be familiar with concepts related to database purposes. This course is suitable for practitioners who are new to relational databases and the Structured Query Language (SQL).

Further Training

After some further on-the-job experience with SQL, we also recommend students attend our SQL Advanced Querying course to gain higher-level skills in the usage of SQL.

Course content

Introduction to SQL

Client/Server Architecture
Data Organisation in Relational Databases
Using Interactive Query Tools
Syntax Rules for SQL
General Layout and Style Philosophy

Retrieving Data from a Table (SELECT Command)

Selecting all Rows and Columns
Selecting Specific Columns
Using Column Aliases
Searching for Data using the WHERE Clause
Sorting Data using the ORDER BY Clause
Looking for NULL Values
Using DISTINCT to Obtain Unique Values

Summarising Data

The GROUP BY Clause and its General Rules
Aggregate Functions (SUM, AVG, MAX, MIN, COUNT)
Filtering Summary Results using the HAVING Clause

Using Operators

Multiple Search/Filter Conditions
The AND Operator
The OR Operator
The NOT Operator
Using List Operators (IN and NOT IN)
Using Range Operators (BETWEEN and NOT BETWEEN)
Searching Strings using Patterns (the LIKE Operator)

Using Functions

General Rules for using Functions
Case Conversion Functions (UPPER and LOWER)
Obtaining String Fragments using SUBSTRING
Date Functions (GETDATE, DATEDIFF, DATEADD)
Date Conversion (DATENAME, DATEPART)

Using Joins

Multiple Tables in a Single Query
INNER Joins
LEFT OUTER and RIGHT OUTER Joins
FULL OUTER Joins
Self-Joins
CROSS Joins (Cartesian Product)
Using the ON Clause for Join Specification
Using the WHERE Clause for Join Specification

Using Sub-Queries

Single Value Sub-Queries
Multiple Value Sub-Queries
Multiple Row Sub-Queries
Correlated Sub-Queries