Preferred method of contact:

Writing Advanced SQL Queries

COURSE TYPE

Advanced

Course Number

929

Duration

3 Days

PDF Add to WishList

SQL is the cornerstone of all relational database operations. In this hands-on course, you learn to exploit the full potential of the SELECT statement to write robust queries using the best query method for your application, test your queries, and avoid common errors and pitfalls. It also teaches alternative solutions to given problems, enabling you to choose the most efficient solution in each situation.

The course describes the ANSI/ISO SQL standard, but also identifies deviations from the standard in the two most widely used database products, Oracle and Microsoft SQL Server.

You Will Learn How To:

  • Maximise the potential of SQL to build powerful, complex and robust SQL queries
  • Query multiple tables with inner joins, outer joins and self joins
  • Construct recursive common table expressions
  • Summarise data using aggregation and grouping
  • Execute analytic functions to calculate ranks
  • Build simple and correlated subqueries
  • Thoroughly test SQL queries to avoid common errors
  • Select the most efficient solution to complex SQL problems

Important Course Information

Who Should Attend:

  • Those who are developing applications using relational databases, or who are using SQL to extract and analyse data from databases and need to use the full power of SQL queries.

Recommended Experience:

Course Outline

  • Introduction and Overview

SQL fundamentals

  • Why SQL can be both easy and difficult
  • Recommendations for thorough testing

Retrieving data with SELECT

  • Expressions
  • Literals
  • Handling NULLs properly

Executing queries

  • Analysing query plans
  • Enhancing query performance
  • Retrieving partly results with FETCH and OFFSET
  • Selecting the best alternatives
  • Avoiding errors and pitfalls
  • Querying Multiple Tables

Implementing various types of joins

  • Inner joins
  • Cross joins
  • Left, right and full outer joins
  • Equijoins vs. theta joins
  • The performance implications of joins
  • Adding filter conditions to outer joins

Writing self joins

  • Joining a table to itself
  • Chaining self joins
  • Solving time-interval problems

Combining queries with set operators

  • UNION
  • UNION ALL
  • INTERSECT
  • EXCEPT
  • Aggregate Functions

Summarising data with aggregate functions

  • COUNT
  • SUM
  • AVG
  • MIN
  • MAX
  • Managing NULLs
  • identifying duplicates

Grouping data

  • GROUP B
  • Applying conditions with HAVING
  • Calculating moving averages
  • Building crosstab reports

Extending group queries

  • Nesting grouped aggregates
  • Joins and grouping
  • Introducing subtotals with CUBE and ROLLUP
  • Performing Extensive Analysis with Analytic Functions

The OVER clause

  • Specifying the ordering before applying the function
  • Splitting the result set into logical partitions

Calculating ranks

  • RANK and DENSE_RANK
  • ROW_NUMBER with ordered sets
  • Calculating percentiles

Extending the use of aggregates

  • Partitioning in multiple levels
  • Computing running totals
  • Comparing row and aggregate values
  • Top-N queries
  • Defining sliding window boundaries
  • Building Subqueries

Self-contained subqueries

  • Subqueries in conditions and column expressions
  • Creating multilevel subqueries
  • Avoiding problems when subqueries return NULLs
  • Handling multirow subquery results
  • Finding gaps in number series

Correlated subqueries

  • Accessing values from the outer query
  • EXISTS vs. IN
  • Identifying duplicates
  • Avoiding accidental correlation

Common table expressions

  • Reusable subqueries
  • Recursive subqueries
  • Traversing hierarchies
  • Breaking Down Complex Queries
  • Overcoming SQL limitations
  • Reducing complexity and improving performance
Show complete outline
Show Less

Convenient Ways to Attend This Instructor-Led Course

Hassle-Free Enrolment: No advance payment required to reserve your seat.
Tuition Fee due 30 days after you attend your course.

In the Classroom

Live, Online

Private Team Training

In the Classroom — OR — Live, Online

Tuition Fee — Standard: £1695  

17 - 19 Jan (3 Days)
9:00 AM - 4:30 PM GMT
London / Online (AnyWare) London / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

18 - 20 Apr (3 Days)
9:00 AM - 4:30 PM BST
London / Online (AnyWare) London / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

18 - 20 Jul (3 Days)
9:00 AM - 4:30 PM BST
London / Online (AnyWare) London / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

17 - 19 Oct (3 Days)
9:00 AM - 4:30 PM BST
London / Online (AnyWare) London / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

AFTERNOON START: Attend these live courses online via Anyware

29 Nov - 1 Dec (3 Days)
2:00 PM - 9:30 PM GMT
Herndon, VA / Online (AnyWare) Herndon, VA / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

20 - 22 Dec (3 Days)
2:00 PM - 9:30 PM GMT
New York / Online (AnyWare) New York / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

14 - 16 Feb (3 Days)
2:00 PM - 9:30 PM GMT
Herndon, VA / Online (AnyWare) Herndon, VA / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

14 - 16 Mar (3 Days)
1:00 PM - 8:30 PM GMT
New York / Online (AnyWare) New York / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

16 - 18 May (3 Days)
2:00 PM - 9:30 PM BST
Herndon, VA / Online (AnyWare) Herndon, VA / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

6 - 8 Jun (3 Days)
2:00 PM - 9:30 PM BST
New York / Online (AnyWare) New York / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

15 - 17 Aug (3 Days)
2:00 PM - 9:30 PM BST
Herndon, VA / Online (AnyWare) Herndon, VA / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

12 - 14 Sep (3 Days)
2:00 PM - 9:30 PM BST
New York / Online (AnyWare) New York / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

14 - 16 Nov (3 Days)
2:00 PM - 9:30 PM GMT
Herndon, VA / Online (AnyWare) Herndon, VA / Online (AnyWare) Reserve Your Seat

How would you like to attend?

Live, Online
In-Class

Guaranteed to Run

Show all dates
Show fewer dates

Private Team Training

Enroling at least 3 people in this course? Consider bringing this (or any course that can be custom designed) to your preferred location as a private team training.

For details, call 0800 282 353 or Click here »

Tuition Fee

Standard

In Classroom or
Online

Standard

£1695

Private Team Training

Contact Us »

Course Tuition Fee Includes:

After-Course Instructor Coaching
When you return to work, you are entitled to schedule a free coaching session with your instructor for help and guidance as you apply your new skills.

Free Course Exam
You can take your Learning Tree course exam on the last day of your course or online at any time after class and receive a Certificate of Achievement with the designation "Awarded with Distinction."

Prev
Next

Training Hours

Standard class hours:
9:00 a.m. - 4:30 p.m.

Last day class hours:
9:00 a.m. - 3:30 p.m.

Free Course Exam – Last Day:
3:30 p.m. - 4:30 p.m.

Each class day:
Informal discussion with instructor about your projects or areas of special interest:
4:30 p.m. - 5:30 p.m.

AFTERNOON START class hours:
2:00 p.m. - 9:30 p.m.


Last day class hours:
2:00 p.m. - 8:30 p.m.


Free Course Exam – Last Day:
8:30 p.m. - 9:30 p.m.


Each class day:
Informal discussion with instructor about your projects or areas of special interest
9:30 p.m. - 10:30 p.m.

- ,

Prev
Next
Chat Now

Please Choose a Language

Canada - English

Canada - Français