Database Querying with SQL

Course Description ( LSQ-60: a 2 day course )

This SQL training course is for those who need to extract data from relational database servers like Microsoft SQL Server, Oracle, IBM DB2, PostgreSQL and MySQL using ANSI standard Structured Query Language (SQL). While attendees gain much experience designing complex SQL queries using standard functions, joins and subqueries, SQL action statements which facilitate data or database modification do not form part of this course. So as to master the syntax of the language, the course is highly practical in nature and the focus throughout is on coding SQL by hand. On completion, a comprehensive set of course notes, examples, tutor and attendee scripts are provided on a free USB pen drive to take away.

Suggested Prerequisites

No prior SQL training or relational database experience is assumed. While the course is for those with little or no experience of working with SQL, it is a course for IT Professionals.


view pricing details here

An Overview of Relational Databases

  • The Role of the Database Server
  • Interacting with a Database Server: The Client
  • About Databases, Schemas, Tables, Rows and Columns
  • Primary Keys and Foreign Keys Explained
  • Introducing Data Types: Character, Numeric, Date and Time

Introducing SQL

  • How to Create and Edit SQL
  • About Statements, Batches and Scripts
  • Executing and Parsing SQL Scripts
  • SQL Syntax and The Rules of SQL
  • About Keywords, Identifiers. Operators, Whitespace and Case
  • About the Semi Colon
  • SQL Conventions and Good Practice

Writing Queries with SQL: First Steps

  • Introducing Queries: The SELECT Statement
  • The Clauses of the SELECT Statement
  • About Optional Clauses and Mandatory Clauses
  • Using FROM to Specify the Source Table(s)
  • Retrieving Entire Tables
  • Retrieving Specific Columns
  • The Importance of Clause Order
  • How to Build Successful Queries
  • Types of Output: About the Result Set
  • Using Column Aliases to Rename Columns
  • Performing Calculations
  • Using Numeric and String Operators to Create Derived Output
  • Ways of Limiting the Output
  • Using ORDER BY to Sort the Output
  • Ways of Working: Some Tips

Using WHERE to Filter Results

  • Working with Comparison Operators (=, >= etc)
  • Numeric and String Based Filtering
  • Filtering Based on Calculations
  • Eliminating Duplicate Results with DISTINCT
  • Working with Execution Order
  • Column Aliases: Where You Can and Cannot Use Them
  • Extending Filters with AND and OR
  • Solving AND/OR Difficulties with Brackets
  • Excluding Results with NOT: Some Tips
  • Range Filtering using BETWEEN and IN
  • NULL and its Implications Explained
  • Catering for NULL
  • Matching Patterns with LIKE

Getting Results From Multiple Tables

  • Qualifying Column Names
  • Joins Explained
  • The Different Types of Joins
  • Creating an Inner Join: WHERE Syntax
  • Creating an Inner Join: INNER JOIN Syntax
  • Table Aliases: The Need
  • Working with Self Joins
  • Outer Joins: An Example
  • How to Simplify Joins: An Approach

Using Standard SQL Functions

  • How to Use Standard SQL Functions to Modify Results
  • How to Find the Right Function
  • Mathematical, String and Conversion Functions
  • Functions for Modifying and Calculating Dates
  • Formatting Numbers to Two Decimal Places
  • Replacing NULL with a Specific Value
  • Using Standard Functions in WHERE
  • Using CASE to Specify Output Conditions
  • Manipulating Dates

Grouping and Summarizing Results

  • The difference Between Tabular and Scalar Results
  • Using Aggregate Functions (MAX(), SUM(), AVG(), COUNT() etc)
  • The Way Aggregate Functions Work
  • Where to Use and Where Not to Use Aggregate Functions
  • Using GROUP BY to Group Results
  • The Need for HAVING: Filtering the Result Table

Working with Subqueries

  • Subqueries Explained
  • Where you can Use Subqueries
  • How to Successfully Construct Subqueries
  • Subqueries for Filtering
  • Subqueries to Create Derived Columns

On Site Requirements

Remember, we provide all equipment and software required to deliver a course at your premises. Aside from this, we need a suitably quiet and equipped room with enough work space for each attendee and a whiteboard or flipchart. Most courses involve the use of a PC projector and we bring our own. But either a projector screen, or usually just a clear wall, would be very helpful.

Other Courses to Consider

on site training courses available in:  

  • London
  • , Birmingham
  • , Edinburgh
  • , Manchester
  • , Scotland
  • , Glasgow
  • , Nottingham
  • , Midlands
  • , Bristol
  • , Wales
  • , Cardiff
  • , Dublin
  • , Belfast
  • , Leeds
  • , Liverpool
  • , Sheffield
  • , Reading
  • , Oxford
  • , Cambridge
  • , Southampton
  • , Newcastle
  • , Durham
  • , Warrington.

and across the UK and Ireland

email us now   or telephone:  01785 223253 
courses:    SQL    Transact SQL    SQL Server    Oracle SQL    IBM DB2    MySQL    PostgreSQL    XSLT    XML    XML Schema    VBScript    Full List
some customers:
  •  
  • public sector:
  •  
  • local authorities:
  •  
  •    flexible training    your venue or ours    London - Midlands - Scotland    and across the UK
     01785 223253
    instant written quotations
       development
     "Easy to understand."
    (NHS attendee)