SQL QUERY WRITING: FOUNDATION & PRACTICAL QUERY DEVELOPMENT
SQL is an essential tool for retrieving, organising and analysing information stored in relational databases. This practical two-day course introduces SQL query writing, from working with database tables and retrieving records to combining information and producing more detailed results.
Using a sample training database, you'll practise writing SQL statements, filtering and sorting records, performing calculations and working with information across multiple tables. The course also covers joins, SQL functions, subqueries and Common Table Expressions (CTEs), alongside techniques for identifying and correcting query errors.
Designed for beginners, the training provides a practical foundation for working with SQL and applying query-writing techniques across a range of relational database environments. No previous SQL experience is required, although basic familiarity with Windows applications is recommended.
Two Day Course

COURSE OBJECTIVES
This course provides a practical introduction to writing SQL queries and working with information stored in relational databases. Delegates will become familiar with database structures, table relationships and the SQL statements used to retrieve, filter and organise information.
Through practical exercises, delegates will learn to combine records from multiple tables, perform calculations and summarise results using SQL functions. They will also work with conditional logic, data conversions and more advanced querying techniques, including subqueries and Common Table Expressions (CTEs).
By the end of the course, delegates will be able to write and troubleshoot SQL queries, interpret common error messages and apply consistent formatting practices. These skills provide a foundation for retrieving and analysing information within their own database environments.
COURSE CONTENT
Understanding Relational Databases
Become familiar with relational database structures, including tables, records, fields, primary and foreign keys. Examine table relationships, database schemas and the SQL Server Management Studio (SSMS) environment.
Retrieving Data with SELECT
Write SELECT statements to retrieve information from database tables. Choose individual columns or complete records, apply column aliases, use literal values and create calculated columns with basic arithmetic.
Filtering Data with WHERE
Control which records appear in query results using WHERE conditions. Apply comparison operators, AND, OR and NOT, alongside BETWEEN, IN, LIKE, wildcards and NULL handling.
Sorting Query Results
Arrange query results using ORDER BY. Sort information in ascending or descending order, apply multiple sorting criteria and use column aliases to organise the returned records.
Aggregate Functions & Grouping
Summarise information using COUNT, SUM, AVG, MIN and MAX. Group records with GROUP BY, apply multiple grouping criteria and use HAVING to filter aggregated results.
Working with Multiple Tables
Retrieve related information from different database tables using SQL joins. Work with INNER JOIN, LEFT JOIN and RIGHT JOIN, and examine how matching and non-matching records affect query results.
Working with Text & Date Functions
Manipulate text using UPPER, LOWER, LEFT, RIGHT, SUBSTRING and CONCAT. Work with GETDATE, YEAR, MONTH and DAY to retrieve date information and perform date calculations.
Numeric Functions & Data Conversion
Perform numerical calculations using ROUND, ABS and mathematical functions. Examine SQL data types and convert values using CAST and CONVERT, including techniques for formatting dates.
Using Conditional Logic
Create conditional calculations using SQL CASE expressions. Apply simple CASE statements to return different values according to specified conditions within a query.
Working with Subqueries
Retrieve information using queries nested within other SQL statements. Create subqueries within WHERE clauses and SELECT statements to support more detailed data retrieval.
Common Table Expressions (CTEs)
Become familiar with Common Table Expression syntax and its practical applications. Use CTEs to organise SQL statements, simplify complex queries and make code easier to read.
Query Design & Troubleshooting
Identify common SQL errors and interpret database error messages. Apply consistent formatting, improve query readability and follow good coding practices when writing and troubleshooting SQL statements.
PRACTICAL LEARNING
This instructor-led course combines demonstrations with hands-on exercises using a sample training database. Delegates will practise writing and running SQL queries, retrieving information, applying filters and calculations, and combining records from related tables.
As the course progresses, practical activities introduce more complex queries using SQL functions, conditional logic, subqueries and Common Table Expressions. Delegates will also work through common errors and practise formatting SQL statements for clarity and accuracy.
The exercises provide opportunities to apply each technique before moving on to the next topic, helping delegates prepare for working with SQL in their own database environments.
CALL 01284 763040 TO BOOK YOUR PLACE

